Wouldn't the $("#my-form [EMAIL PROTECTED]'input']").blur(function() { be my trigger?
I would like to validate as the user tabs through the form. How would I not run the function if the field just tabbed from is blank? Thanks for your validation of my script. Nishan On Oct 13, 7:30 am, "Jörn Zaefferer" <[EMAIL PROTECTED]> wrote: > Validation should always hook into the submit event, eg. > $(#myform").submit(function() { ... }); > That handles both clicking the submit button as well as hitting enter > while an input field has focus. > > Apart from that, the form plugin handles submitting forms via ajax and > handling the response quite well, including file > uploads:http://malsup.com/jquery/form/ > > Jörn > > On Mon, Oct 13, 2008 at 5:57 AM, Nishan Karassik <[EMAIL PROTECTED]> wrote: > > > Hello, > > > I have never written a Jquery script, but have, over the last few > > days, compiled the following, but was hoping someone could look over > > this to see if I had problems. > > > $(document).ready(function () { > > $("#my-form [EMAIL PROTECTED]'input']").blur(function() { > > var queryString = $.("#my-form").formSerialize(); > > $.post("/path/to/your/validation.php", queryString, > > function(validation_errors) { > > // do something like changing a css class, disable > > submit... > > $.each(validation_errors, function(err_id, > > err_message) { > > $(err_id).val() = err_message; > > } > > )}; > > }); > > )}); > > > Thanks, > > Nishan