Re: [jQuery] Re: validation: how do I call a function to perform after a validation is done?
Ok I'm using this invalidHandler: function(form, validator) { PossitionStuff.possitionErrors(); }, And it works but it doesn't fire till the second validation I need it to fire on the first go around too On 11/18/09 4:06 PM, StephenJacob turnstylecreat...@gmail.com wrote: Hmm, i'm not really sure how to pull that off. I would look into the showErrors option or possibly the Valid function. http://docs.jquery.com/Plugins/Validation/validate http://docs.jquery.com/Plugins/Validation/valid Good luck and let us know how things turn out for ya! On Nov 18, 3:47 pm, Atkinson, Sarah sarah.atkin...@cookmedical.com wrote: I want the function to trigger when there are errors it's to alter the position of both the errors and other elements on the page. So I got the function to fire but I can't seem to changes the css on the error boxes. $('label .error').css({'left' : basePossitionOffset.left}); Does not work. I should be able to alter the error messages just like anyother element in the DOM right? On 11/18/09 3:34 PM, StephenJacob turnstylecreat...@gmail.com wrote: It depends on your method of validation. Here is the form/validation system I use for my contact form. Hope this helps! script type=text/javascript src=js/jquery-1.3.2.min.js/script script type=text/javascript src=js/jquery.validate.js/script script type=text/javascript src=js/jquery.form.js/script script type=text/javascript $(document).ready(function() { $(#contactForm).validate({ rules: { fullname: { required: true, minlength: 2 }, email: { required: true, email: true }, company: { required: true, minlength: 2 }, phone: { required: true, minlength: 2 }, }, messages: { fullname: 'span class=errorPlease enter your bfull name/b./ span', email: 'span class=errorPlease enter a valid bemail address/ b./span', company: 'span class=errorPlease enter your bcompany/b./ span', phone: 'span class=errorPlease enter your bphone number/b./ span' }, submitHandler: function(form) { $('#contactForm').ajaxSubmit({ resetForm: true, target: '#success', success: function() { $(#success).fadeIn('slow').fadeTo(5000, 1).fadeOut('slow'); } }); } }); }); /script form id=contactForm method=POST action=process.php //FORM GOES HERE /form On Nov 18, 3:08 pm, Atkinson, Sarah sarah.atkin...@cookmedical.com wrote: Do I have to create a custom method and stick a function in there?
[jQuery] Re: validation: how do I call a function to perform after a validation is done?
It depends on your method of validation. Here is the form/validation system I use for my contact form. Hope this helps! script type=text/javascript src=js/jquery-1.3.2.min.js/script script type=text/javascript src=js/jquery.validate.js/script script type=text/javascript src=js/jquery.form.js/script script type=text/javascript $(document).ready(function() { $(#contactForm).validate({ rules: { fullname: { required: true, minlength: 2 }, email: { required: true, email: true }, company: { required: true, minlength: 2 }, phone: { required: true, minlength: 2 }, }, messages: { fullname: 'span class=errorPlease enter your bfull name/b./ span', email: 'span class=errorPlease enter a valid bemail address/ b./span', company: 'span class=errorPlease enter your bcompany/b./ span', phone: 'span class=errorPlease enter your bphone number/b./ span' }, submitHandler: function(form) { $('#contactForm').ajaxSubmit({ resetForm: true, target: '#success', success: function() { $(#success).fadeIn('slow').fadeTo(5000, 1).fadeOut('slow'); } }); } }); }); /script form id=contactForm method=POST action=process.php //FORM GOES HERE /form On Nov 18, 3:08 pm, Atkinson, Sarah sarah.atkin...@cookmedical.com wrote: Do I have to create a custom method and stick a function in there?
Re: [jQuery] Re: validation: how do I call a function to perform after a validation is done?
I want the function to trigger when there are errors it's to alter the position of both the errors and other elements on the page. So I got the function to fire but I can't seem to changes the css on the error boxes. $('label .error').css({'left' : basePossitionOffset.left}); Does not work. I should be able to alter the error messages just like anyother element in the DOM right? On 11/18/09 3:34 PM, StephenJacob turnstylecreat...@gmail.com wrote: It depends on your method of validation. Here is the form/validation system I use for my contact form. Hope this helps! script type=text/javascript src=js/jquery-1.3.2.min.js/script script type=text/javascript src=js/jquery.validate.js/script script type=text/javascript src=js/jquery.form.js/script script type=text/javascript $(document).ready(function() { $(#contactForm).validate({ rules: { fullname: { required: true, minlength: 2 }, email: { required: true, email: true }, company: { required: true, minlength: 2 }, phone: { required: true, minlength: 2 }, }, messages: { fullname: 'span class=errorPlease enter your bfull name/b./ span', email: 'span class=errorPlease enter a valid bemail address/ b./span', company: 'span class=errorPlease enter your bcompany/b./ span', phone: 'span class=errorPlease enter your bphone number/b./ span' }, submitHandler: function(form) { $('#contactForm').ajaxSubmit({ resetForm: true, target: '#success', success: function() { $(#success).fadeIn('slow').fadeTo(5000, 1).fadeOut('slow'); } }); } }); }); /script form id=contactForm method=POST action=process.php //FORM GOES HERE /form On Nov 18, 3:08 pm, Atkinson, Sarah sarah.atkin...@cookmedical.com wrote: Do I have to create a custom method and stick a function in there?
[jQuery] Re: validation: how do I call a function to perform after a validation is done?
Hmm, i'm not really sure how to pull that off. I would look into the showErrors option or possibly the Valid function. http://docs.jquery.com/Plugins/Validation/validate http://docs.jquery.com/Plugins/Validation/valid Good luck and let us know how things turn out for ya! On Nov 18, 3:47 pm, Atkinson, Sarah sarah.atkin...@cookmedical.com wrote: I want the function to trigger when there are errors it's to alter the position of both the errors and other elements on the page. So I got the function to fire but I can't seem to changes the css on the error boxes. $('label .error').css({'left' : basePossitionOffset.left}); Does not work. I should be able to alter the error messages just like anyother element in the DOM right? On 11/18/09 3:34 PM, StephenJacob turnstylecreat...@gmail.com wrote: It depends on your method of validation. Here is the form/validation system I use for my contact form. Hope this helps! script type=text/javascript src=js/jquery-1.3.2.min.js/script script type=text/javascript src=js/jquery.validate.js/script script type=text/javascript src=js/jquery.form.js/script script type=text/javascript $(document).ready(function() { $(#contactForm).validate({ rules: { fullname: { required: true, minlength: 2 }, email: { required: true, email: true }, company: { required: true, minlength: 2 }, phone: { required: true, minlength: 2 }, }, messages: { fullname: 'span class=errorPlease enter your bfull name/b./ span', email: 'span class=errorPlease enter a valid bemail address/ b./span', company: 'span class=errorPlease enter your bcompany/b./ span', phone: 'span class=errorPlease enter your bphone number/b./ span' }, submitHandler: function(form) { $('#contactForm').ajaxSubmit({ resetForm: true, target: '#success', success: function() { $(#success).fadeIn('slow').fadeTo(5000, 1).fadeOut('slow'); } }); } }); }); /script form id=contactForm method=POST action=process.php //FORM GOES HERE /form On Nov 18, 3:08 pm, Atkinson, Sarah sarah.atkin...@cookmedical.com wrote: Do I have to create a custom method and stick a function in there?