views:

29

answers:

2
+1  A: 

have a look at the validation plugin for jQuery: http://bassistance.de/jquery-plugins/jquery-plugin-validation/

Moin Zaman
@Moin, as I said I dont have trouble with validation on ready, but haven't been able to get this to work as a submit function
Dirty Bird Design
A: 

You are binding a function to submit, however you still need to call $("#formOne").submit() after you run your validation.

ie:

$("#formOne").submit(function() { // run your validations

        if (valid) $(this).submit();

    });
Steve
@Steve, where do I put my rules, error and submit handler?
Dirty Bird Design
You would put your validations either in another function or inline after the comment that says "// run your validations" the last line the if (valid) was designed to be an example of checking a boolean value and then submitting the form. Hope that makes sense.
Steve