hi i've got this code to validate the form which works but it doesn't carry out the else statement and direct to the page if the form is valid
function printpage() {
if (!mandatoryText(document.getElementById('FIRSTNAME_FIELD'), 'First name')) return false;
if (!mandatoryText(document.getElementById('LASTNAME_FIELD'), 'Last name')) return false;
if (!mandatoryText(document.getElementById('ZIP_CODE_FIELD'), 'Post code')) return false;
if (!mandatoryText(document.getElementById('EMAIL_FIELD'), 'Email')) return false;
if (!isEmail(document.getElementById('EMAIL_FIELD'))) return false;
if (!isDateOK(document.getElementById('LAST_SHOWROOM_VISIT_FIELD').value)) return false;
if (document.getElementById('LAST_SHOWROOM_VISIT_FIELD').value != '') modifyDateFormat(document.getElementById('LAST_SHOWROOM_VISIT_FIELD'));
document.getElementById('emvForm').submit();
if (document.getElementById('LAST_SHOWROOM_VISIT_FIELD').value != '') modifyDateFormat(document.getElementById('LAST_SHOWROOM_VISIT_FIELD'));
else {
return true;
var p1 = document.getElementById('SELECTED_PRODUCT_1_FIELD').value;
window.location.href = "summary.html?" + "p1" + "=" + p1;
}
}
Aucun commentaire:
Enregistrer un commentaire