I'm using the following code to make sure all the fields of the form sent are not empty:
function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
{alert(alerttxt);return false}
else {return true}
}
}
function validate_form(thisform)
{
with (thisform)
{
if (validate_required(fname,"Enter your name!")==false)
{fname.focus();return false}
}
with (thisform)
{
if (validate_required(lname,"Enter your surname!")==false)
{lname.focus();return false}
}
}
I have a group of radio buttons that i also need to validate. Can anybody help me to include the validation for radio button in this script?