$(document).ready(function(){ UtilsForm.initCaptcha(); $("#pageContact #cdCaptcha a").click(function(){ UtilsForm.modifCaptcha(); }); $("#pageContact form").submit(function(){ UtilsForm.reinitMsgErr($(this)); UtilsForm.verifChamps( $("#Nom").val().length == 0, $("#Nom").parent(), "
Champ obligatoire
"); UtilsForm.verifChamps( $("#Mail").val().length == 0, $("#Mail").parent(), "Champ obligatoire
"); UtilsForm.verifChamps( $("#Mail").val().length != 0 && !UtilsForm.validMail($("#Mail").val()), $("#Mail").parent(), "Format incorrect
"); UtilsForm.verifChamps( $("#Sujet").val().length == 0, $("#Sujet").parent(), "Champ obligatoire
"); UtilsForm.verifChamps( $("#Texte").val().length == 0, $("#Texte").parent(), "Champ obligatoire
"); UtilsForm.verifChamps( $("#captcha").val().length == 0, $("#captcha").parent().parent(), "Champ obligatoire
"); if ( $(".err", $(this)).length > 0 ){ $(".msgErreur", $(this)).html("Le formulaire contient des erreurs (champ obligatoire, mal formaté, ...).
"); return false; } }); });