finding <input> item in Mozilla

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jodleren

    finding <input> item in Mozilla

    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
  • jhurstus@gmail.com

    #2
    Re: finding &lt;input&gt ; item in Mozilla

    On Jan 10, 8:35 am, jodleren <sonn...@hot.ee wrote:
    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

    Comment

    Working...