[Javascript] Netscape object model : forms in div/layer
Rodney Myers
rmyers at i-way.co.uk
Tue Apr 24 05:15:40 CDT 2001
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>
<p><a href="javascript:alert('Document has form :
'+hasForm(window.document))">TEST for FORMS</a></p>
--
Shop at ssistant Add-ons and Developer Workshops
http://www.aflyingstart.net/addons/
Rodney Myers
Based in Oxford, England
Technical Director, Shop at ssistant eCommerce Solutions
More information about the Javascript
mailing list