By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,921 Members | 1,479 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,921 IT Pros & Developers. It's quick & easy.

finding <input> item in Mozilla

P: n/a
Hi

I tried getElementById, it works in IE, but how I find items on a form
properly?
I can write a small for myself, but is there a function to find
<inputitems on a form?
That is, standard JS which also works in Mozilla

WBR
Sonnich
Jan 10 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Jan 10, 8:35*am, jodleren <sonn...@hot.eewrote:
Hi

I tried getElementById, it works in IE, but how I find items on a form
properly?
I can write a small for myself, but is there a function to find
<inputitems on a form?
That is, standard JS which also works in Mozilla

WBR
Sonnich
getElementById should works on all modern browsers, including
Mozilla. If your code is working in IE only, it's probably due to the
fact that you set the name attribute but not the id attribute of the
input tag. IE falls back to the name attribute when using
getElementById, but Mozilla based browsers do not.

Make sure your tag looks like this: <input type="text" name="some_id"
id="some_id" ... />

Also, duplicate Id's within a page can cause getElementById to behave
in strange ways.

-Joey
Jan 10 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.