function checkForm(theForm) { if (theForm.no_serie.value == "") { alert("Veuillez indiquer le numéro de licence de votre logiciel Avantage!"); theForm.no_serie.focus(); return (false); } if (theForm.no_serie.value.length < 5) { alert("Tapez au moins 5 caractères dans le champ \"Numéro de licence\"!"); theForm.no_serie.focus(); return (false); } if (theForm.no_serie.value.length > 6) { alert("Tapez au plus 6 caractères dans le champ \"Numéro de licence\"!"); theForm.no_serie.focus(); return (false); } var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-"; var checkStr = theForm.no_serie.value; var allValid = true; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } } if (!allValid) { alert("Votre numéro de licence ne doit contenir que des lettres et des chiffres!"); theForm.no_serie.focus(); return (false); } if (theForm.realname.value == "") { alert("Veuillez inscrire le nom de votre entreprise!"); theForm.realname.focus(); return (false); } if (theForm.telephone.value == "") { alert("Veuillez inscrire votre téléphone!"); theForm.telephone.focus(); return (false); } if (theForm.nom.value == "") { alert("Veuillez inscrire le nom de la personne responsable!"); theForm.nom.focus(); return (false); } if (theForm.email.value == "") { alert("Veuillez inscrire votre courriel!"); theForm.email.focus(); return (false); } return (true); }