Re: [jQuery] Re: validation: how do I call a function to perform after a validation is done?

2009-11-19 Thread Atkinson, Sarah
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"  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" 
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"  wrote:
>
> It depends on your method of validation. Here is the form/validation
> system I use for my contact form. Hope this helps!
>
> 
> 
> 
> 
>
> $(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: 'Please enter your 
> full name. span>',
> email: 'Please enter a valid 
> email address b>.',
> company: 'Please enter your 
> company. span>',
> phone: 'Please enter your 
> phone number. span>'
> },
> submitHandler: function(form) {
>
> $('#contactForm').ajaxSubmit({
> resetForm: true,
> target: '#success',
> success: function() {
> 
> $("#success").fadeIn('slow').fadeTo(5000, 1).fadeOut('slow');
> }
> });
> }
> });
>
> });
>
> 
>
> 
>
> //FORM GOES HERE
>
> 
>
> On Nov 18, 3:08 pm, "Atkinson, Sarah" 
> 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" 
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"  wrote:
>
> It depends on your method of validation. Here is the form/validation
> system I use for my contact form. Hope this helps!
>
> 
> 
> 
> 
>
> $(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: 'Please enter your 
> full name. span>',
>                         email: 'Please enter a valid 
> email address b>.',
>                         company: 'Please enter your 
> company. span>',
>                         phone: 'Please enter your 
> phone number. span>'
>                 },
>                 submitHandler: function(form) {
>
>                         $('#contactForm').ajaxSubmit({
>                                 resetForm: true,
>                                 target: '#success',
>                                 success: function() {
>                                         
> $("#success").fadeIn('slow').fadeTo(5000, 1).fadeOut('slow');
>                                 }
>                         });
>                 }
>         });
>
> });
>
> 
>
> 
>
> //FORM GOES HERE
>
> 
>
> On Nov 18, 3:08 pm, "Atkinson, Sarah" 
> 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"  wrote:

It depends on your method of validation. Here is the form/validation
system I use for my contact form. Hope this helps!






$(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: 'Please enter your 
full name.',
email: 'Please enter a valid 
email address.',
company: 'Please enter your 
company.',
phone: 'Please enter your phone 
number.'
},
submitHandler: function(form) {

$('#contactForm').ajaxSubmit({
resetForm: true,
target: '#success',
success: function() {

$("#success").fadeIn('slow').fadeTo(5000, 1).fadeOut('slow');
}
});
}
});

});





//FORM GOES HERE



On Nov 18, 3:08 pm, "Atkinson, Sarah" 
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!






$(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: 'Please enter your 
full name.',
email: 'Please enter a valid 
email address.',
company: 'Please enter your 
company.',
phone: 'Please enter your phone 
number.'
},
submitHandler: function(form) {

$('#contactForm').ajaxSubmit({
resetForm: true,
target: '#success',
success: function() {

$("#success").fadeIn('slow').fadeTo(5000, 1).fadeOut('slow');
}
});
}
});

});





//FORM GOES HERE



On Nov 18, 3:08 pm, "Atkinson, Sarah" 
wrote:
> Do I have to create a custom method and stick a function in there?