Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing general tags in Netscape 4.x DOM

Status
Not open for further replies.

Trevman

Programmer
Jul 23, 2000
183
US
Is there any way to access a tag without an ID in the Netscape 4.x DOM?

I need to access a form tag (the only one on the page).

I am trying to replicate the behavior of document.getElementsByTagName("FORM").item(0)

is there any way to do this?

Thanks. ===
Supports Mozilla and Web Standards
Knows HTML/XHTML, CSS1, JavaScript, PHP, C++, DOM1
===
 
Supports Mozilla and Web Standards??? Why are you asking about the evil NS4 then? The only elements available for scripting via NS4 are layers (absolutely positioned elements - document.layers.layername), images (document.images), form elements ( document.formname.elements ) and anchors (document.anchors).

Listen to your conscious and don't offer dhtml support for netscape 4. Its holding back the web. jared@eae.net -
 
Well This is for a script that I wrote that checks to make sure all the textarea and input fields on a page are filled in -- and submits the form through javascript. I was never intending to support netscape 4.x but I am using the script right now in a situation where a good number of netscape 4.x users and I just need to be able to submit the form. (I was not actually going to rewrite the errorchecking code.) ===
Supports Mozilla and Web Standards
Knows HTML/XHTML, CSS1, JavaScript, PHP, C++, DOM1
===
 
You can access all of the form fields in NS4, using the document.formname.elements array. Or you could build your own array of input type=text and textarea elements and cycle through that. I wasn't trying to be condescending by the way ;-)

You can still submit the form in ns4 using document.formname.submit() jared@eae.net -
 
Ok Thanks --

Is there any way to submit the form if you don't have the name?

such as my form might be

<form action=&quot;somepage.php&quot; method=&quot;post&quot;>

how would I submit that form? ===
Supports Mozilla and Web Standards
Knows HTML/XHTML, CSS1, JavaScript, PHP, C++, DOM1
===
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top