function CheckMField(obj) { if (obj.value == "") { alert(obj.name+" is mandatory"); obj.focus(); return false; } return true; } function CheckMSelect(obj) { if (obj.selectedIndex == 0) { alert(obj.name+" is mandatory"); obj.focus(); return false; } return true; } function CheckMCheckbox(obj) { if (obj.checked) { return true; } alert(obj.name+" is mandatory"); return false; } function CheckMRadio(obj) { for (i = 0; i < obj.length; i++) if (obj[i].checked) return true; alert(obj[0].name+" is mandatory"); // obj[0].focus(); return false; } function CheckMail(dati) { if ((dati.indexOf("@") == -1) | (dati.indexOf(".") == -1) | (dati.length < 7)) { alert(dati+" is not a valid e-mail"); document.iscrizione.email.focus(); return false; } return true; } function Validate() { with (document.iscrizione) { if (!CheckMField(first_name)) return false; if (!CheckMField(last_name)) return false; if (!CheckMField(email)) return false; if (!CheckMail(email.value)) return false; if (!CheckMSelect(city)) return false; if (!CheckMSelect(country)) return false; if (!CheckMSelect(monthBirth)) return false; if (!CheckMRadio(gender)) return false; if (!CheckMSelect(dayBirth)) return false; if (!CheckMSelect(yearBirth)) return false; if (!CheckMSelect(occupation)) return false; if (!CheckMCheckbox(confirmed_privacy)) return false; } return true; }
EOREGSTR; if ($_POST['publish_reg_client_submit'] == 'Agree Conditions') { $feedback = client_register(); if($feedback[0] == "ok") { print ("| WARNING!!! scoll up and click CONTINUE to confirm your subscription!!! |
| WARNING!!! scoll up and click CONTINUE to confirm your subscription!!! |
| WARNING!!! scoll up and click CONTINUE to confirm your subscription!!! |
| WARNING!!! scoll up and click CONTINUE to confirm your subscription!!! |
$feedback
"; } print ($feedback_str); } else { // Mostra il modulo per la prima volta $feedback_str = ''; echo $reg_str; } // -------------------- // VISUALIZZA IL MODULO // -------------------- ?>