lerouc
Well-Known Member
Well the validation on the form isn't working either...or there is none?
South Africa’s biggest forum. Discuss, discover, and connect with thousands of members.
Well the validation on the form isn't working either...or there is none?
<script language="JavaScript" type="text/JavaScript">
function validateInput() {
if (document.Form1.txtQuestion.value == '') {
alert('Please type in a question.')
return false;
}
if (document.Form1.txtFName.value == '') {
alert('Please type in your first name.')
return false;
}
if (document.Form1.txtSName.value == '') {
alert('Please type in your surname.')
return false;
}
if (document.Form1.txtEmail.value == '') {
alert('Please type in your email address.')
return false;
}
if (document.Form1.txtTelNr.value == '') {
alert('Please type in your telephone number.')
return false;
}
}
Code:<script language="JavaScript" type="text/JavaScript"> function validateInput() { if (document.Form1.txtQuestion.value == '') { alert('Please type in a question.') return false; } if (document.Form1.txtFName.value == '') { alert('Please type in your first name.') return false; } if (document.Form1.txtSName.value == '') { alert('Please type in your surname.') return false; } if (document.Form1.txtEmail.value == '') { alert('Please type in your email address.') return false; } if (document.Form1.txtTelNr.value == '') { alert('Please type in your telephone number.') return false; } }
Theres no return value for true![]()
Is this not the part of the code not only the part of the site that checks if you left a field blank?
<script language="JavaScript" type="text/JavaScript">
function validateInput() {
if (document.Form1.txtQuestion.value == '') {
alert('Please type in a question.')
return false;
}
else if (document.Form1.txtFName.value == '') {
alert('Please type in your first name.')
return false;
}
else if (document.Form1.txtSName.value == '') {
alert('Please type in your surname.')
return false;
}
else if (document.Form1.txtEmail.value == '') {
alert('Please type in your email address.')
return false;
}
else if (document.Form1.txtTelNr.value == '') {
alert('Please type in your telephone number.')
return false;
}
else
{
return true;
}
}
</script>
This would be a better working example:
Code:<script language="JavaScript" type="text/JavaScript"> function validateInput() { if (document.Form1.txtQuestion.value == '') { alert('Please type in a question.') return false; } else if (document.Form1.txtFName.value == '') { alert('Please type in your first name.') return false; } else if (document.Form1.txtSName.value == '') { alert('Please type in your surname.') return false; } else if (document.Form1.txtEmail.value == '') { alert('Please type in your email address.') return false; } else if (document.Form1.txtTelNr.value == '') { alert('Please type in your telephone number.') return false; } else { return true; } } </script>
There is no need to return true.....
There is no need to return true.....
How's the name of the one image on the site:
"faq_off.jpg"
Ha ha ha ha![]()