SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    Web Design Addict
    Join Date
    Mar 2004
    Posts
    2,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript form validation error

    I'm developing a site which has a basic contact form.

    I'm trying to validate this form instantly using this tutorial: http://tetlaw.id.au/view/javascript/...eld-validation

    I'm using Firefox with the Firebug add-on and whenever I load my test page with the contact form, I receive this error message in Firebug:

    $(form).getElementsByTagName is not a function
    getElements([])prototype.js (line 1799)
    initialize("contact_form", Object immediate=true)validation.js (line 88)
    create()
    I've got this to work before on other sites, but for some reason it's not working on this site and I just don't know why and I don't understand what the error is telling me.

    The URL to the test page is: http://test.ksba.org/index.php/static/ask-ksba

    Can anyone explain what's going on and maybe what I should to do fix it?
    Deron Sizemore
    ----------
    My Sites: LogoGala | Golf Ledger (coming soon)
    Twitter: Deron Sizemore

  2. #2
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just a stab in the dark, but move the jquery includes above the prototype etc.


  3. #3
    Web Design Addict
    Join Date
    Mar 2004
    Posts
    2,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well that stab was a good one.

    After moving the jQuery code above the prototype and validation includes the form validation now works, but the jquery fading header image does not....

    You can see what's happening now on the test page.
    Deron Sizemore
    ----------
    My Sites: LogoGala | Golf Ledger (coming soon)
    Twitter: Deron Sizemore

  4. #4
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lol i'd love to know where the saying comes from.

    as for the fade. It may be worth sticking JQuery above prototype and the fade below the prototype.

    Or have a look at the other sites you've used it on and see what order they are in?


  5. #5
    Web Design Addict
    Join Date
    Mar 2004
    Posts
    2,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well when I said originally that I've used it on other sites, I was referring to the form validation. I wasn't thinking originally that the problem was with the jquery stuff. I've never used the jquery along side the form validation. I just assumed I had a problem with the form validation only earlier.

    Moving the jQuery didn't do the trick.

    I assume I've got something named the same in one of the 4 js files and it's getting confused.
    Deron Sizemore
    ----------
    My Sites: LogoGala | Golf Ledger (coming soon)
    Twitter: Deron Sizemore


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
  •