<script>
function check()
{
with(document.form1)
{
if(s[2].checked && txt.value=="")
{
alert("不能为空!")
return false;
}
}
return true;
}
</script>
<form name="form1" method=post onsubmit="return check()">
<input type="radio" name="s" value="1">
<input type="radio" name="s" value="2">
<input type="radio" name="s" value="3">
<input type="text" name=txt>
<input type="submit">
</form>