对这个“确定报名”中所有的是否选择做js判断
<!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>
<link href="/css.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a:active {
text-decoration: none;
}
-->
</style>
<script language="javascript">
function cc()
{
if(!checkRaddion(document.MebornGame.yuanyin,'对不起,请选择购买家居的原因!'))
return false;
else if(!checkRaddion(document.MebornGame.zhudao,'对不起,请选择您家家居购买谁持主导意见!'))
return false;
else if(!checkRaddion(document.MebornGame.proType,'对不起,请选择您要买什么家具!'))
return false;
else if(!checkRaddion(document.MebornGame.caizhi,'对不起,请选择您像购买何种材质工艺的家具!'))
return false;
else if(!checkRaddion(document.MebornGame.fengge,'对不起,请选择您要购买什么风格的家具!'))
return false;
else if(!checkRaddion(document.MebornGame.zhongdian,'对不起,请选择您购买家具最看重以下那一点!'))
return false;
else if(!checkRaddion(document.MebornGame.Price,'对不起,请选择您感觉卧室五件套什么价位比较合理!'))
return false;
else if(!checkRaddion(document.MebornGame.genghuan,'对不起,请选择如果您更换家具,原因是什么!'))
return false;
else
return true;
}
//参数rad为:radio对象,error为错误提示语句
function checkRaddion(rad,error)
{
// 获取radio对象的所有项的个数
var a = rad.length;
// 判断选择数量
var scount = 0;
// 循环所有的项
for(var i=0;i<a;i++)
{
//如果被选中,则scount加1
if(rad.item(i).checked)
scount ++;
}
// 如果选择数量的值等于0,则表示没有选择,弹出提示消息,返回false
if(scount == 0)
{
alert(error);
return false;
}
else
return true;
}
</script>
<!--#include virtual="include/head.asp"-->
<table width="1000" border="1" align="center" cellpadding="1" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td align="center" valign="middle"><table width="800" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td width="79%" align="center" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3" align="right" valign="middle"><div align="left" >
<div align="center">美邦团购报名表</div>
</div></td>
</tr>
<tr>
<td colspan="3" align="center" valign="middle">
<form method="post" name="MebornGame" id="MebornGame" >
<table width="84%" border="0" background="" bgcolor="#FFFFCC">
<tr>
<td height="20" colspan="5" align="right" valign="middle" class="xihei9" ><div align="left" class="chuhei12">
<div align="center">购买意向调查表</div>
</div>
<hr /></td>
</tr>
<tr>
<td align="right" valign="middle" class="xihei9"> </td>
<td height="20" colspan="4" align="right" valign="middle" class="xihei9"><div align="left">1.您购买家居的原因是什么?</div></td>
</tr>
<tr>
<td align="right" valign="middle" class="xihei9"> </td>
<td height="20" colspan="4" align="right" valign="middle" class="xihei9"><div align="left">
<label>
<input type="radio" name="yuanyin" value="家居换代" />
</label>
<label>家居换代</label>
<label>
<input type="radio" name="yuanyin" value="心房布置" />
</label>
心房布置
<label>
<input type="radio" name="yuanyin" value="随房出租" />
</label>
随房出租
<label>
<input type="radio" name="yuanyin" value="一般性添置" />
</label>
一般性添置</div></td>
</tr>
<tr>
<td align="right" valign="middle" class="xihei9"> </td>
<td height="20" colspan="4" align="right" valign="middle" class="xihei9"><div align="left">2.您家家居购买谁持主导意见?</div></td>
</tr>
<tr>
<td align="right" valign="middle" class="xihei9"> </td>
<td height="20" colspan="4" align="right" valign="middle" class="xihei9"><div align="left">
<input type="radio" name="zhudao" value="老公" />
老公
<input type="radio" name="zhudao" value="老婆" />
老婆
<input type="radio" name="zhudao" value="父母" />
父母
<input type="radio" name="zhudao" value="子女" />
子女</div></td>
</tr>
<tr>
<td align="right" valign="middle" class="xihei9"> </td>
<td height="20" colspan="4" align="right" valign="middle" class="xihei9"><div align="left">3.您要买什么家具?</div></td>
</tr>
<tr>
<td align="right" valign="middle" class="xihei9"> </td>
<td height="20" colspan="4" align="right" valign="middle" class="xihei9"><div align="left">
<label>
<input type="checkbox" name="proType" value="卧室家具" />
</label>
卧室家具
<input type="checkbox" name="proType" value="客厅家具" />
客厅家具
<input type="checkbox" name="proType" value="餐厅家具" />
餐厅家具
<input type="checkbox" name="proType" value="整体家具" />
整体家具
<input type="checkbox" name="proType" value="其他" />
其他</div></td>
</tr>
<tr>
<td align="right" valign="middle" class="xihei9"> </td>
<td colspan="4" align="right" valign="middle" class="xihei9"><div align="left">4.您像购买何种材质工艺的家具?</div></td>
</tr>
<tr>
<td align="right" valign="middle" class="xihei9"> </td>
<td colspan="4" align="right" valign="middle" class="xihei9"><div align="left">
<input type="checkbox" name="caizhi" value="板式家具" />
板式家具
<input type="checkbox" name="caizhi" value="实木家具" />
实木家具
<input type="checkbox" name="caizhi" value="软体家具" />
软体家具
<input type="checkbox" name="caizhi" value="板木结合家具" />
板木结合家具</div></td>
</tr>
<tr>
<td align="right" valign="middle" class="xihei9"> </td>
<td colspan="4" align="right" valign="middle" class="xihei9"><div align="left">5.您要购买什么风格的家具?</div></td>
</tr>
<tr>
<td align="right" valign="middle" class="xihei9"> </td>
<td colspan="4" align="right" valign="middle" class="xihei9"><div align="left">
<input type="radio" name="fengge" value="美式" />
美式
<input type="radio" name="fengge" value="田园" />
田园
<input type="radio" name="fengge" value="中式" />
中式
<input type="radio" name="fengge" value="现代经典" />
现代经典 </div></td>
</tr>
<tr>
<td align="right" valign="middle" class="xihei9"> </td>
<td colspan="4" align="right" valign="middle" class="xihei9"><div align="left">6.您购买家具最看重以下那一点?</div></td>
</tr>
<tr>
<td align="right" valign="middle" class="xihei9"> </td>
<td colspan="4" align="right" valign="middle" class="xihei9"><div align="left">
<input type="radio" name="zhongdian" value="风格" />
风格
<input type="radio" name="zhongdian" value="价格" />
价格
<input type="radio" name="zhongdian" value="功能" />
功能 </div></td>
</tr>
<tr>
<td align="right" valign="middle" class="xihei9"> </td>
<td colspan="4" align="right" valign="middle" class="xihei9"><div align="left">7.您感觉卧室五件套什么价位比较合理?</div></td>
</tr>
<tr>
<td align="right" valign="middle" class="xihei9"> </td>
<td colspan="4" align="right" valign="middle" class="xihei9"><div align="left">
<input type="radio" name="Price" value="3000-5000" />
3000-5000
<input type="radio" name="Price" value="5000-8000" />
5000-8000
<input type="radio" name="Price" value="8000-10000" />
8000-10000
<input type="radio" name="Price" value="10000以上" />
10000以上</div></td>
</tr>
<tr>
<td align="right" valign="middle" class="xihei9"> </td>
<td colspan="4" align="right" valign="middle" class="xihei9"><div align="left">8.如果您更换家具,原因是什么?</div></td>
</tr>
<tr>
<td align="right" valign="middle" class="xihei9"> </td>
<td colspan="4" align="right" valign="middle" class="xihei9"><div align="left">
<input type="radio" name="genghuan" value="家具损坏" />
家具损坏
<input type="radio" name="genghuan" value="审美疲劳" />
审美疲劳
<input type="radio" name="genghuan" value="功能不能满足" />
功能不能满足
<input type="radio" name="genghuan" value="其他" />
其他</div></td>
</tr>
<tr>
<td align="right" valign="middle" class="xihei9"> </td>
<td colspan="4" align="right" valign="middle" class="xihei9"> </td>
</tr>
<tr>
<td align="right" valign="middle" class="xihei9"> </td>
<td align="left" valign="middle" class="xihei9"><input name="ok" type="button" id="ok" value="确定报名" οnclick="return cc()" /></td>
<td colspan="3" align="left" valign="middle" class="xihei9" >
<input name="rewrite" type="reset" id="rewrite" value="重 写" /></td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td width="8%" align="right" valign="middle" class="xihei9"><iframe id="iframe1" name="iframe1" style="display:none;"></iframe>
<iframe id="iframe2" name="iframe2" style="display:none;"></iframe></td>
<td width="20%" align="right" valign="middle" class="xihei9"> </td>
<td width="44%" align="left" valign="middle" class="xihei9"> </td>
</tr>
</table></td>
</tr>
<tr>
<td align="left" valign="top"> </td>
<td align="left" valign="top"> </td>
</tr>
</table></td>
</tr>
<tr>
<td align="center" valign="middle"> </td>
</tr>
</table>
</body>
</html>