<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<script>
function check()
{
for(var i=0;i<document.frm.major.length;i++)
{
if(document.frm.major[i].checked!=true)
{
alert('学历还没选择,请选择!');
}
}
}
</script>
<body>
<form name="frm">
<input type="radio" name="major" value="专科" />专科<input type="radio" name="major" value="本科" />本科<input type="radio" name="major" value="硕士研究生" />硕士研究生<br />
<input type="submit" onclick="check()" />
</form>
</body>
</html>怎么判别不了呢?求解中。。
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<script>
function check()
{
for(var i=0;i<document.frm.major.length;i++)
{
if(document.frm.major[i].checked!=true)
{
alert('学历还没选择,请选择!');
}
}
}
</script>
<body>
<form name="frm">
<input type="radio" name="major" value="专科" />专科<input type="radio" name="major" value="本科" />本科<input type="radio" name="major" value="硕士研究生" />硕士研究生<br />
<input type="submit" onclick="check()" />
</form>
</body>
</html>怎么判别不了呢?求解中。。
解决方案 »
- js 高手看一下(拖动问题)
- jquery ASP.NET ajax传值问题
- 关于自动填写浏览器页面
- 新手问题,为何在自机上写普通一句javascrip代码运行都会有安全警告,而看新浪都没有提示警告
- 收藏 不显示删除回复显示所有回复显示星级回复显示得分回复 找不到错在哪?ajax中xmlHttp.responseText接收问题(新)
- 怎么用Javascript生成验证码
- ShowmodalDialog中使用window.open,确不能弹出新窗口
- 如何把动态生成表中n个下拉框和n个文本框记录保存下来?
- 有什么好的判断日期格式的javascript代码么
- 使用DOM绑定html元素出错
- js第13讲 JavaScript的事件操作
- jQuery 筛选name的问题
{
for(var i=0;i<document.frm.major.length;i++)
{
if(document.frm.major[i].checked == true)
{
return;
}
}
alert('学历还没选择,请选择!');
}
function check()
{
var flag = true;
for(var i=0;i<document.frm.major.length;i++)
{
if(document.frm.major[i].checked==true)
{
flag = false;
return;
}
}
if(flag){
alert('学历还没选择,请选择!');
}
}
</script>