// JavaScript Document function comprova_form_contacte() { error = ""; frm = document.frm_contacte; if(frm.nom.value.length < 3) error += 'Fill in the field: Name\n'; if(frm.telefon.value.length < 3) error += 'Fill in the field: Phone number\n'; if(frm.xmal.value.length < 3) error += 'Fill in the field: E-mail\n'; else if(!(/\S+@\S+\.\S+/.test(frm.xmal.value))) error += 'Incorrect e-mail\n'; if(frm.captcha_client.value.length < 4) error += 'Write the code\n'; if(error) alert(error); else frm.submit(); }