Results 1 to 5 of 5

Thread: Can't get this AJAX form validation to work

  1. #1

    Can't get this AJAX form validation to work

    http://tetlaw.id.au/view/javascript/...eld-validation


    Bear with me please, I'm no javascript expert.

    I believe I've followed everything except for knowing where to put:

    Code:

    <script type="text/javascript">
    new Validation('form-id');
    </script>

    Does that go in the <head> of my document? Or not? It also says that "he basic method is to attach to the form's onsubmit event" but in the examples and demo I don't see an onsubmit event so I have no idea how to duplicate that.

    Like I said, these two areas are the only two I'm a little fuzzy on. I DID download the files and uploaded the two javascript libraries (prototype/validation) to my server and I'm making sure that I use the correct class for each input field.

    Any advice would be great!
    Last edited by deronsizemore; 03-08-2007 at 10:35 AM.

  2. #2
    Registered
    Join Date
    Aug 2006
    Location
    Sacramento, CA
    Posts
    208
    The link you included is broken, so I'm not exactly sure what that code does.

    If you add the checking function to the onsubmit event, it will check the input when the form is submitted, and I would assume since you say its supposed to be AJAX, that it should check the input on the fly, so I don't think you would want to trigger it on the form being submitted.
    ________
    Oxygen Vaporizer
    Last edited by rpanella; 03-17-2011 at 10:41 AM.

  3. #3

  4. #4
    Registered
    Join Date
    Aug 2006
    Location
    Sacramento, CA
    Posts
    208
    From looking at the code it looks like you need to place the code in question anywhere in the HTML as long as its below the form that you are validating.
    ________
    Mazda Mx-5 10Th Anniversary Model Specifications
    Last edited by rpanella; 03-17-2011 at 10:41 AM.

  5. #5
    Hi - I actually tried that a little bit ago and got it to work but everytime you refresh the page it gives you and "object" error. And that's all it says is "object" error. While at work earlier I had one of our programmers look at it and try to debug the error and he couldn't figure it out. The error was really generic and didn't say much about what needed to be fixed. I started a discussion about this at the google group the developer set up and he gave me a couple more ideas, so I'll see what happens.

Similar Threads

  1. Hurry! ASP.NET AJAX Hosting (Formerly ATLAS) for $1.67/mo only
    By hostingatoz in forum The Marketplace
    Replies: 0
    Last Post: 02-09-2007, 11:59 PM
  2. Form results to formatted PDF format
    By CreationNation in forum Website Programming & Databases
    Replies: 1
    Last Post: 04-07-2006, 01:37 PM
  3. Which site to work on ?
    By aj8 in forum Advertising & Affiliate Programs
    Replies: 7
    Last Post: 08-28-2005, 04:53 AM
  4. Passing a URL through a form
    By moonshield in forum Website Programming & Databases
    Replies: 4
    Last Post: 04-20-2005, 12:35 PM
  5. Form positioning
    By lo0ol in forum HTML, CSS, Layout, and Design
    Replies: 7
    Last Post: 12-06-2003, 10:50 AM

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
  •