/* VALIDATION CODE This code needs to be left into your contest to work properly. You may carefully edit lines below as needed. Please review comments on changing various options to make your contest work more to your specific needs. */ function popup(p,w,h){ popUp = window.open(p, “window”, “menubar=no,scrollbars=yes,resizable=no,status=no,width=”+w+”,height=”+h); popUp.focus(); } function maximaLong(texto,maxlong) { var tecla, in_value, out_value; if (texto.value.length > maxlong) { in_value = texto.value; out_value = in_value.substring(0,maxlong); texto.value = out_value; alert(‘Text too long! 1000 words max’); return false; } return true; } function checkForm2(form) { form.prenom_candidate.required = true; form.prenom_candidate.requiredError = ‘Candidate’s Given Name’; form.nom_candidate.required = true; form.nom_candidate.requiredError = ‘Candidate’s Family Name’; form.organisation_candidate.required = true; form.organisation_candidate.requiredError = ‘Organization’; form.num_organisation_candidate.required = true; form.num_organisation_candidate.requiredError = ‘Organization’s tax number’; form.adresse_candidate.required = true; form.adresse_candidate.requiredError = ‘Candidate’s Address’; form.ville_candidate.required = true; form.ville_candidate.requiredError = ‘Candidate’s City’; form.province_candidate.required = true; form.province_candidate.requiredError = ‘Province’; form.postal_code_candidate.pattern = ‘postal code’; form.postal_code_candidate.patternError=’Candidate’s Postal Code’; form.postal_code_candidate.required = true; form.postal_code_candidate.requiredError = ‘Candidate’s Postal Code’; form.home_phone1_candidate.required = true; form.home_phone1_candidate.requiredError = ‘Area code Candidate’s Telephone (home)’; form.home_phone2_candidate.required = true; form.home_phone2_candidate.requiredError = ‘Candidate’s Telephone (home)’; form.email_candidate.required = true; form.email_candidate.requiredError = ‘Candidate’s E-mail address’; form.email_candidate.pattern = ’email’; form.email_candidate.patternError = ‘Candidate’s E-mail address’; form.agree_rules.required = true; form.agree_rules.requiredError = ‘You must check rules!’; form.redaction.required = true; form.redaction.requiredError = ‘Write your text here (500 to 1000 words)’; form.prenom.required = true; form.prenom.requiredError = ‘Your Given Name’; form.nom.required = true; form.nom.requiredError = ‘Your Family Name’; form.lien.required = true; form.lien.requiredError = ‘Relation to candidate’; form.home_phone1.required = true; form.home_phone1.requiredError = ‘Area code of your Telephone 1’; form.home_phone2.required = true; form.home_phone2.requiredError = ‘Your Telephone 1’; form.email.required = true; form.email.requiredError = ‘Your E-mail address’; form.email.pattern = ’email’; form.email.patternError = ‘Your E-mail address’; var errors = getFormErrors(form); if (errors.length > 0) { var errorMessage = ‘You have to fill the following information before subjecting your formnn’; for (var errorIndex = 0; errorIndex < errors.length; errorIndex++) { errorMessage += '- ' + errors[errorIndex] + 'n'; } alert(errorMessage); return false; } /* if (form.redaction.value.length < 3200) { alert('Text too short! 500 mots min'); return false; } */ // no errors: return true return true; } function DoSubmit(){ if (checkForm2(document.ContestForm)){ document.ContestForm.submit();} }
Living
Most Dynamic Woman
...