Well, it finally works ;)
I tried an other syntax and it went good.
Here comes the code, if it could help :
$("#interv").validate({
errorContainer: $("#alertes"),
errorLabelContainer: $("#alertes ul"),
errorWrapper: "li",
rules: {
int_societe: { required: true }
},
messages: {
int_societe: "Test soc"
},
submitHandler: function(form) {
$("#interv").ajaxSubmit({
success: ValidatInterv,
target: "#alertes2",
url: "soa.php?action=modif"
});
}
});
Thanx for the help,
Freud
On Aug 16, 8:53 am, Freud <[EMAIL PROTECTED]> wrote:
> Hi,
>
> first of all, excuse me for my language, I'm french ;) so I'll try to
> make it simple...
>
> I'm using the JQuery Form Plugin and it works perfectly fine :
>
> $(document).ready(function() {
> var options2 = {
> target: "#alertes",
> url: "soa.php?action=modif"
> };
>
> $("#interv").submit(function() {
> $(this).ajaxSubmit(options2);
> return false;
> });
>
> });
>
> I tried the validation form plugin, which is quite amazing, and it
> also works great.
>
> $(document).ready(function() {
> $.validator.setDefaults({
> errorContainer: $("#alertes"),
> errorLabelContainer: $("#alertes ul"),
> errorWrapper: "li",
> rules: {
> int_societe: { required: true }
> },
> messages: {
> int_societe: "Test soc"
> }
> //,submitHandler: function(form) {$
> ("#interv").ajaxSubmit(options2);},
> });
> $("#interv").validate();
>
> });
>
> Now, I wanna use both. That's where it started to go wrong. When I
> uncomment the SubmitHandler line, the validation is still OK but the
> form is submitted normally, not using the Ajaxian method.
>
> Could someone help me on this case ? I spent my night on this stuff
> and I start feeling depressed :)
>
> Thx,
> Freud