<script language="JavaScript">
function chg()
{
if(document.getElementById("cb").checked==true){
document.getElementById("s1").style.display="";
}else{
document.getElementById("s1").style.display="none";
}
}
function subt(theForm)
{
if ((document.getElementById("cb").checked==true) && theForm.s1.value == "")
{
alert("有一项没填!");
theForm.s1.focus();
return false;
}
return true;
}
</script>
<form name="form1" action="abc.php" method="post" onSubmit="return subt(this)">
<input type="checkbox" name="cb" id="cb" value="" onclick="chg()">
<input type="text" name="s1" style="display:none">
<input type="submit" name="Submit" value="提交" />
</form>
function chg()
{
if(document.getElementById("cb").checked==true){
document.getElementById("s1").style.display="";
}else{
document.getElementById("s1").style.display="none";
}
}
function subt(theForm)
{
if ((document.getElementById("cb").checked==true) && theForm.s1.value == "")
{
alert("有一项没填!");
theForm.s1.focus();
return false;
}
return true;
}
</script>
<form name="form1" action="abc.php" method="post" onSubmit="return subt(this)">
<input type="checkbox" name="cb" id="cb" value="" onclick="chg()">
<input type="text" name="s1" style="display:none">
<input type="submit" name="Submit" value="提交" />
</form>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货