Loading ...
Sorry, an error occurred while loading the content.

Bug in Dialog when name/id equals "name"

Expand Messages
  • thoughtdomain
    If in the Dialog there is a form element like this: First name
    Message 1 of 3 , Jun 29, 2006
    • 0 Attachment
      If in the Dialog there is a form element like this:

      <label for="name">First name</label>
      <input name="name" type="text" id="name" size="20" maxlength="20" />

      The form will not be able to submit, an error of 'elements.length' is
      null or not an object error appears.
    • happydals
      ... Are you sure it s only when the id/name is name ? I get this error in IE on several forms even without an element by that name, but I don t get the error
      Message 2 of 3 , Sep 12, 2006
      • 0 Attachment
        --- In ydn-javascript@yahoogroups.com, "thoughtdomain" <iwscol@...> wrote:
        >
        > If in the Dialog there is a form element like this:
        >
        > <label for="name">First name</label>
        > <input name="name" type="text" id="name" size="20" maxlength="20" />
        >
        > The form will not be able to submit, an error of 'elements.length' is
        > null or not an object error appears.
        >


        Are you sure it's only when the id/name is "name"? I get this error in
        IE on several forms even without an element by that name, but I don't
        get the error at all in Firefox. Is something else doing on perhaps?
      • happydals
        I found the problem in my case. The issue was that the form ID was not unique in the document. There was a div with id addJournal and the form id is
        Message 3 of 3 , Sep 14, 2006
        • 0 Attachment
          I found the problem in my case. The issue was that the form ID was not
          unique in the document. There was a div with id "addJournal" and the
          form id is "AddJournal"

          Since Firefox is case-senstive, these are two different IDs, but IE's
          jscript is not case-sensitive, so they are the same. The setForm
          function just does a lookup by getElementById, which doesn't work when
          the ID is not unique.
        Your message has been successfully submitted and would be delivered to recipients shortly.