SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist
    Join Date
    Apr 2004
    Location
    Boston
    Posts
    482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    getelementbyid not working in Firefox

    Hello,

    I am using a text link to submit a form with the following funciton:

    Code:
    <a href="#" onmousedown=\"javascript: getElementById(form1).submit();>CLICK HERE</a>
    It works beautifully in IE but not at all in Firefox. I use the same piece of code to submit a form using an image and it works with the image.

    Any one have any idea how to fix this in Firefox/Mozilla?

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What value does your variable form1 contain?

    If the form's ID is form1, then you need to use getElementById("form1") (note the quotation marks).
    Birnam wood is come to Dunsinane

  3. #3
    SitePoint Evangelist
    Join Date
    Apr 2004
    Location
    Boston
    Posts
    482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I fixed it, the <form> tag was missing hte id I only had the name="" field in there.

    THanks for the help.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •