日期:2014-05-16 浏览次数:20972 次
<script>
function check(f){
if(f.f_tjnf.checked){
if(f.y1.value==''){alert('请选择y1!');f.y1.focus();return false;}
if(f.y2.value==''){alert('请选择y2!');f.y2.focus();return false;}
}
}
</script>
<form name="form2" onsubmit="return check(this)">
<input type="checkbox" name="f_tjnf"/>
<select name="y1"><option value="">请选y1</option>
<script>for(i=1980;i<=2020;i++)document.write('<option value="'+i+'">'+i+'</option>')</script>
</select>
<select name="y2"><option value="">请选y2</option>
<script>for(i=1980;i<=2020;i++)document.write('<option value="'+i+'">'+i+'</option>')</script>
</select><input type="submit" value="查询"/>
</form>