js-表单验证
<form onsubmit="return checkForm()">
on?<input id="on" type="radio" name="agree" value="on"/><br/>
off?<input id ="off" type="radio" name="agree" value="off"/>
<input type="submit" name="test" />
</form>
function checkForm(){
if(document.getElementById("ao").checked)
{
alert('checked');
return true;
}
else
{
alert('not checked');
return false;
}
}
浙公网安备 33010602011771号