日期:2014-05-20  浏览次数:20868 次

html问题
<tr>
<td align="right" width="200">开始时间</td>
<td align="left"><t:datetext t:id="begDate" value="obj.begDate"/></td>
<td align="right">结束时间</td>
<td align="left"><t:datetext t:id="endDate" value="obj.endDate"/></td>
<td align="left">
<t:radiogroup t:value="obj.sex">
<input t:id="sex1" type="radio" t:type="radio" t:value="literal:恢复" class="radio"/>恢复
<input t:id="sex2" type="radio" t:type="radio" t:value="literal:永久停用" class="radio"/>永久停用
</t:radiogroup>
</td>
</tr>

要做的效果就是,如果点击永久停用按钮,将结束时间的输入框灰掉(不能输入) 具体怎么做,在线等

------解决方案--------------------
HTML code

<html>
<head>
<title>XXXXXX</title>
<script language="javascript">
function test() {
    if(document.getElementById("sex2").checked) {
        document.getElementById("endDate").disabled = true;
    } else {
        document.getElementById("endDate").disabled = false;
    }
}
</script>
</head>
<body>
<table>
<tr>
<td align="right" width="200">start time:</td>
<td align="left"><input type="text" id="begDate" value="2012/03/06"/></td>
<td align="right">end time:</td>
<td align="left"><input type="text" id="endDate" value="2012/03/31"/></td>
<td align="left">
<input id="sex1" name="group" type="radio" value="recover" onClick="test();"/>recover
<input id="sex2" name="group" type="radio" value="stop" onClick="test();"/>stop
</td>
</tr>
</table>
</body>
</html>

------解决方案--------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>test2.html</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">

<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->

</head>
</style>
<script type="text/javascript" src="jquery-1.4.4.js"></script>
<script>
function myClick(){
var endNode = document.getElementById('end');
var value = document.getElementById('start').value;
endNode.disabled=true;
endNode.value = value;
}
</script>

<body>
<tr>
<td align="right" width="200" >开始时间</td>
<td align="left"><t:datetext t:id="begDate" value="obj.begDate id="start""/></td>
<td align="right">结束时间</td>
<td align="left"><t:datetext t:id="endDate" value="obj.endDate" id="end/></td>
<td align="left">
<t:radiogroup t:value="obj.sex">
<input t:id="sex1" type="radio" t:type="radio" t:value="literal:恢复" class="radio"/>恢复