在画面上我有两个radio(一组):
<input name="name" type="radio" value="2" onclick="period()"/> 苹果
<input name="name" type="radio" value="1" checked onclick="noPeriod()"/> 橘子还有text框:
<input type="text" id="id" name="dDate" />我现在想 点value是”2“的radio,text框可用,点value是”1“的radio,text框不可用js代码:function period() {
document.getElementById("id").disabled=true;
}function noPeriod() {
document.getElementById("id").disabled=false;
}为什么我点完了 画面没有反应,是不是没有进行画面刷新啊??
那位大哥会请指教一下。最好有个例子什么的。小弟在此先谢谢
<input name="name" type="radio" value="2" onclick="period()"/> 苹果
<input name="name" type="radio" value="1" checked onclick="noPeriod()"/> 橘子还有text框:
<input type="text" id="id" name="dDate" />我现在想 点value是”2“的radio,text框可用,点value是”1“的radio,text框不可用js代码:function period() {
document.getElementById("id").disabled=true;
}function noPeriod() {
document.getElementById("id").disabled=false;
}为什么我点完了 画面没有反应,是不是没有进行画面刷新啊??
那位大哥会请指教一下。最好有个例子什么的。小弟在此先谢谢
document.getElementById("id").style.display = "none";
}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
function period() {
document.getElementById("id").disabled = true;
}function noPeriod() {
document.getElementById("id").disabled = false;
}
</script>
</head><body>
<input name="name" type="radio" value="2" onclick="noPeriod()"/> 苹果
<input name="name" type="radio" value="1" checked onclick="period()"/> 橘子
<input type="text" id="id" name="dDate" />
</body>
</html>
document.getElementById("id").disabled="";
function checkRaido(o)
{
if(o.value ==1)
{
document.getElementById("id").disabled="disabled";}
else
{
document.getElementById("id").disabled="";}
}