Advanced Search

Results 1 to 4 of 4

Thread: Use Spry Validation with jQuery Form to Form Wizard (v1.1)

  1. #1
    Join Date
    Dec 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Use Spry Validation with jQuery Form to Form Wizard (v1.1)

    1) Script Title: jQuery Form to Form Wizard (v1.1)

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...formwizard.htm

    3) Describe problem:

    I'd like to use Dreamweaver's SPRY validation with this script. I created the form with Spry fields and implemented the Form Wizard script. I spry validate on Blur and submit and that works fine, but I want to prevent user from moving on to next section if fields have spry errors.

    How can I use onpagechangestart function to prevent user from going to next section?

  2. #2
    Join Date
    Aug 2004
    Posts
    9,863
    Thanks
    3
    Thanked 960 Times in 949 Posts
    Blog Entries
    15

    Default

    I'm not familiar with Spry Validation specifically; does the script return a value of false (or some other indicator) when a field fails a validation test? In general when you return a value of false inside the onpagechangestart() function of Form Wizard, it halts the user from proceeding to another form page until a value of true is returned instead. The later two examples on the supplementary page shows this in action: http://www.dynamicdrive.com/dynamici...suppliment.htm
    DD Admin

  3. #3
    Join Date
    Dec 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I believe Spry widgets do return false. I pulled this code from one of the widgets where I think Spry checks for false onSubmit.

    if (!Spry.Widget.Form.onSubmit) {
    Spry.Widget.Form.onSubmit = function(e, form)
    {
    if (Spry.Widget.Form.validate(form) == false) {
    return false;
    }
    return true;
    };
    };

  4. #4
    Join Date
    Dec 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Here is wht worked

    onpagechangestart:function($, i, $fieldset){
    if ( Spry.Widget.Form.validate(form1) == true ){
    alert("This is validated");
    return true;
    }
    else
    {
    alert("This is not validated");
    return false;
    }

    }

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
  •