|
Help needed with my validation
Hi there, i'm trying to addapt a validation script to incorporate radio button validation, but even when i've highlighted the radio button, the validation is still kicking in and saying that the button needs clicking...
here's my script:
- Code: Select all
<script type="text/javascript">
function QuoteFields() {
missinginfo = "";
if (document.frmCRMLead.q1.value == null) {
missinginfo += "\n - Question 1 Required";
}
if (document.frmCRMLead.q2.value == null) {
missinginfo += "\n - Question 2 Required";
}
if (document.frmCRMLead.q3.value == null) {
missinginfo += "\n - Question 3 Required";
}
if (document.frmCRMLead.q4.value == null) {
missinginfo += "\n - Question 4 Required";
}
if (document.frmCRMLead.q5.value == null) {
missinginfo += "\n - Question 5 Required";
}
if (document.frmCRMLead.q6.value == null) {
missinginfo += "\n - Question 6 Required";
}
if (document.frmCRMLead.q7.value == null) {
missinginfo += "\n - Question 7 Required";
}
if (missinginfo != "") {
missinginfo ="You need to add the following:\n" +
missinginfo + "\n" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else return true;
}
</script>
Last edited by karinne; Jul 9th, 2007 at 12:12.
Reason: Please use [code]...[/code] tags when displaying code!
|