Forum Moderators: open

Message Too Old, No Replies

Netscape and Form elements values returning Null.

         

nsetra57

11:06 pm on Mar 24, 2003 (gmt 0)



Hi, I am problems in retreiving form elements value from Netscape browser. The sample code is below, could someone please help me where is the error?.

<sorry, that is too much code - please see Posting Code [webmasterworld.com]>

*******
I know this is a long lines of code, because may be there is some syntax error . I get all values from the form Null from the Nescape browser, but IE is fine.
Thanks for guidence.

[edited by: tedster at 5:00 pm (utc) on Mar. 25, 2003]

Allen

1:13 pm on Mar 25, 2003 (gmt 0)

10+ Year Member



Make sure that all your tags are closed and are nested properly.

Allen

DrDoc

3:24 pm on Mar 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here's how to do it:

if(document.getElementById) {
// For Gecko, Opera, and new IE
blah = document.getElementById('the_ID').value;
}

else if(document.all) {
// For old IE
blah = document.all['the_ID'].value;
// or...
// blah = document.form_name.field_name.value;
}

else if(document.layers) {
// For Netscape 4
blah = document.layers('the_ID').value;
}

Give the form fields an ID, and replace "the_ID" with that value.