<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style>
input{border:1px solid #cccccc; background-color:expression((this.readOnly && this.readOnly==true)?"#f0f0f0":"")}
</style>
<SCRIPT Language="JavaScript">
function SetEnable() {
if (document.getElementById("rd1").checked)
{
document.getElementById("txt1").readOnly = false;
document.getElementById("txt2").readOnly = true;
document.form1.txt1.focus();
}
else
{
document.getElementById("txt1").readOnly = true;
document.getElementById("txt2").readOnly = false;
document.form1.txt2.focus();
}
}
</SCRIPT>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<p>
<label>
<input type="radio" name="RadioGroup1" id="rd1" value="rd1" onclick="SetEnable()" />
单选</label>
<input type="text" id="txt1" name="textfield" />
<br />
<label>
<input type="radio" name="RadioGroup1" id="rd2" value="rd2" onclick="SetEnable()" />
单选</label>
<input type="text" id="txt2" name="textfield2" />
<br />
</p>
</form>
</body>
</html>
|