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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Netscape format for "getElementsByTagName"

Status
Not open for further replies.

chakuli

Programmer
Aug 1, 2001
3
US
Hi
Can someone suggest a Netscape equivalent of the following statement

" window.document.getElementsByTagName("HTML"); "

Details :-

I have an application form i.e. Insurance Application. For every user who fill up the form I want to store the page as a text file for future edits. What I did was.... on submit, I got the whole source with current values into a hidden variable (HddnHtml) by using the Javascript command given below.

function FormSubmit(form_index)

var aReturn;
if (ns4)
{ document.layers["Content"].document.forms[form_index].submit(); }
else
{
aReturn = window.document.getElementsByTagName("HTML");
alert(aReturn[0].innerHTML);
document.forms[form_index].Hddnhtml.value = aReturn[0].innerHTML;
document.forms[form_index].submit();
}
}

This works in IE but on Netscape it gives me an error "
document.getElementsByTagName is not a valid function". Please notice the syntax for the submit in Netscape. Any workaround guys.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top