[Javascript] referring to a form in a div

Chris Basken chriz at basken.com
Wed May 2 09:48:47 CDT 2001


i did something similar, but my logic was to create my own myForms array,
then cycle through all the layers (and sublayers) in search of forms.  when
a form is found, it's assigned (using eval) to the current element in
myForms (and myForms is incremented only at that point).

when done, you can use myForms to access any form on the page, regardless of
where it is.

if anyone's interested, i'll post the code.


> (Re post)
>
> This script is intended to find a form at any depth of layers in
> Netscape.
> Of limited usefulness as it stands, but I consider it a stepping stone
> towards being able to manipulate data from and/or document forms within
> Netscape layers.
>
> Any holes spotted? Suggestions?
>
>
> <script LANGUAGE='javascript'>
>
> function hasForm(wd){ // For Netscape
> var ret=false;
> if(wd.forms.length>0){return(true);}
> else if(wd.layers.length>0)
>         {
>         for(var i=0;i<wd.layers.length;i++)
>                 {
>                 ret=hasForm(wd.layers[i].document);
>                 if(ret){break;}
>                 }
>         }
> return(ret);
> }
>
> </script>
>
>
> Peter Brunone wrote:
> >
> >     Let me rephrase that.
> >
> >     I tried it, and it didn't work.  The same error just keeps
> popping up,
> > that document.layers.queryInputDiv.selectForm has no properties.
> --
> Shop at ssistant Add-ons and Developer Workshops
> http://www.aflyingstart.net/addons/
>
> Enquiries regarding Shop at ssistant Classic training :
> Call 01256 880770
>
> Rodney Myers
> Based in Oxford, England
> Technical Director, Shop at ssistant eCommerce Solutions
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> http://www.LaTech.edu/mailman/listinfo/javascript
>





More information about the Javascript mailing list