Image Image Image Image Image

© Copyright 2012 ABCoder | Email | RSS

Scroll to Top

To Top




In Ajax
Core JavaScript

By abcoder

Using Dreamweaver Spry validation with jQuery ajax form plugin

On 08, Jun 2009 | In Ajax, Core JavaScript, JavaScript, jQuery | By abcoder

Writing form validation code manually is a boring task. Not only that, editing or adding new fields each time and modifying the validation code accordingly is such a pain. When Dreamweaver added the Spry form validation with CS3 the nightmare is over. The greatest feature of using it is you can do the form validation work automatically with a couple of mouse clicks and no hand written code! And you can easily change/edit or add/remove the fields.

I know jQuery has simple validation plugin but you have to write the codes for it, which is time consuming. I always use the spry validation of dreamweaver as I learned using it for it’s simplicity. When I tried to use it with the jQuery ajax form submit plugin I got disappointed. It didn’t work! I didn’t stop trying. And finally I found the way which I’m gonna share with you :)

Here is the simple code that you need in the “beforeSubmit” parameter of $.ajaxForm

    url: "submit.php",
    beforeSubmit: function(formData, jqForm, options){
        if (Spry) { // checks if Spry is used in your page
            var r = Spry.Widget.Form.validate(jqForm[0]); // validates the form
            if (!r) 
                return r;
    success: successFunction,
    complete: completeFunction

Hope that’ll help a lot boosting your web development.

Tags | , , , , , , , , , , ,


  1. Hey, nice post, really well written. You should post more about this.

  2. Manu Vs

    How did U applay this on your page ….
    Any examples….
    Me also facing the same problem

  3. Rudy


    My name is Rudy and after examining your website, I believe I can help you improve your Search Engine Rankings.

    Do you wish you could increase your online leads? Getting much more traffic from search engines?
    It is much easier and more cost-effective than you might think. We have helped a lot of businesses thrive in this market and we can help you!
    Contact me at and I’ll share with you the cost and the benefits. See you at the top!

  4. This was a lifesaver. Thank you very much!

  5. you are most welcome @Ben

  6. Drew

    Thanks a lot! it worked like magic…

  7. local moron

    Is this still working with the latest version of jquery? I am having some problems getting the Spry.Widget.Form.validate(form1) to work.

    Do you have more source you could show? For dummies?

  8. Using Dreamweaver Spry validation with jQuery ajax form plugin I was recommended this blog by my cousin. I’m not sure whether this post is written by him as nobody else know such detailed about my trouble. You’re incredible! Thanks! your article about Using Dreamweaver Spry validation with jQuery ajax form plugin Best Regards Rolf Nick

  9. Hi Adnan,

    Thanks so much for posting this :-)

    I had been busy pulling my hair out for two solid days before I found your post.