List all elements in a form Does not work in Netscape 
Author Message
 List all elements in a form Does not work in Netscape

I'm trying to list all elements in a form.  This works in IE 4.0.
I have 8 items in the form and below does not work in
Netscape4.5
for (jj=0;jj<8; jj++) {
   strName=document.SearchForm.item(jj,0).name;
   alert(" strName= "+strName);

Quote:
}

Any comments?

TIA
Steve Hall



Mon, 20 May 2002 03:00:00 GMT  
 List all elements in a form Does not work in Netscape


Quote:
> I'm trying to list all elements in a form.  This works in IE 4.0.
> I have 8 items in the form and below does not work in
> Netscape4.5
> for (jj=0;jj<8; jj++) {
>    strName=document.SearchForm.item(jj,0).name;
>    alert(" strName= "+strName);
> }

> Any comments?

RTFM... http://developer.netscape.com/docs/manuals/js/client/jsguide/index.htm
(we'll take Netscape's idiocy of confusing DOM/language as read.)

The Collection is a concept unique to IE's DOM, there are no such things as
collections in Navigators, to get at the elements in a form, you would most
sensibly, and compatibly use the elements array.

strName=document.SearchForm.elements[jj].name

Jim.



Mon, 20 May 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Drop down list does not work in Netscape

2. Dropdown list does not work in Netscape

3. Dependant select lists not working in Netscape

4. Why doe the BLUR not work in IE ???

5. Form element "bug?" in Netscape

6. Stylesheet not working on document.written elements

7. Forms elements are not displayed in positioned divs

8. copy down does not work with netscape 4.74

9. Works with ie but not with Netscape...

10. Javascript that works in IE and not netscape ?

11. works in netscape but not IE

12. help, this javascript function works with IE but not Netscape

 

 
Powered by phpBB® Forum Software