1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
function CheckField(formulaire) {
var FormRegisterForm = document.forms['RegisterForm'];
var FormContactForm = document.forms['ContactForm'];
var wEmailCtc = FormContactForm.elements['EmailCtc'].value;
var wEmail = FormRegisterForm.elements['Email'].value;
if (formulaire == 'RegisterForm') {
document.getElementById('valid').href = 'javascript:void(0)';
alert(document.getElementById('valid').href);
if (wEmail.search(/^[_a-z0-9-]+(.[_a-z0-9-]+)*[^._-]@[a-z0-9-]+(.[a-z0-9]{2,4})*$/) == -1) {
alert('Adresse email obligatoire !');
FormRegisterForm.elements['Email'].focus();
}
else if (FormRegisterForm.elements['CGVDemandeEssai'].checked == false) {
alert('Vous devez accepter les conditions générales obligatoire pour pouvoir poursuivre.');
FormRegisterForm.focus();
}
else {
FormRegisterForm.submit();
}
}
if (formulaire == 'ContactForm' ) {
document.getElementById('valid2').href = 'javascript:void(0)';
alert(document.getElementById('valid2').href);
if (wEmailCtc.search(/^[_a-z0-9-]+(.[_a-z0-9-]+)*[^._-]@[a-z0-9-]+(.[a-z0-9]{2,4})*$/) == -1) {
alert('Adresse email obligatoire !');
FormContactForm.elements['EmailCtc'].focus();
}
else if (FormContactForm.elements['CGVDemandeEssaiCtc'].checked == false) {
alert('Vous devez accepter les conditions générales obligatoire pour pouvoir poursuivre.');
FormContactForm.elements['CGVDemandeEssaiCtc'].focus();
}
else {
FormContactForm.submit();
}
}
} |