<script language="JavaScript" type="text/javascript">
<!--
function x(){
return;
}
function validate(){
if ((document.getstartedform.name.value=='') || (document.getstartedform.email.value=='') || (document.getstartedform.mobile.value=='')){
alert('Please check all fields again before submitting as there are some missing entries');
return false;
}
if ((document.getstartedform.doyouneed[0].checked == false ) && ( document.getstartedform.doyouneed[1].checked == false ) && ( document.getstartedform.doyouneed[2].checked == false ) && ( document.getstartedform.doyouneed[3].checked == false ))
{
alert ( "Please register your type of need" );
return false;
}
else {
return true;
}
}
//-->
</script>
part of this code works and part does not.
this part works:
if ((document.getstartedform.name.value=='') || (document.getstartedform.email.value=='') || (document.getstartedform.mobile.value=='')){
alert('Please check all fields again before submitting as there are some missing entries');
return false;
}
but this part does not:
if ((document.getstartedform.doyouneed[0].checked == false ) && ( document.getstartedform.doyouneed[1].checked == false ) && ( document.getstartedform.doyouneed[2].checked == false ) && ( document.getstartedform.doyouneed[3].checked == false ))
{
alert ( "Please register your type of need" );
return false;
}
the top one is for a text field. the botton one is for a checkbox (i assume it can work for a radio button or checkbox) or radio button. either way it doesnt work at all. can someone adjust this so they both work?