asp.net中关于文本属性随下拉列表框的内容更改而更改的问题 一个页面上有两个控件 一个下拉列表 一个 文本框一个下拉列表框里两个内容一个是 正常 一个是不正常 当选择正常时 如何让后面的文本变为只读,也就是不能输入东西的文本框 望大虾指点 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在dropDownList的SelectedIndexChanged中,判断后设置文本框TextBox的Readonly属性为true <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!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 runat="server"> <title>无标题页</title> <script language ="javascript" > window .onload = test; function test() { if(document .getElementById ("Select1").options[0].selected) { document .getElementById ("t").readOnly = "readOnly" ; } if(document .getElementById ("Select1").options[1].selected) { document .getElementById ("t").readOnly = "" ; } } </script></head><body> <form id="form1" runat="server"> <div> <input type="text" id="t" /> <select id="Select1" onchange ="test();"> <option>正常</option> <option>不正常</option> </select> <br /> </div> </form></body></html> 鼠标移至不同省份弹出不同层 listBox 显示 求一数据库设计,望大神不吝指导 如何调用别人写的DLL 惯例升星散分 共同学习vs.net textbox双击之后如何谈出一个新的窗体? 怎么可以准确的判断出一个会话的结束? Acess数据库打开的问题 保存动态创建的窗体控件 我使用OracleConnection来连接oracle 9i,请问连接字符串该怎样写? asp.net(C#) C2C电子商务网站商品收藏夹代码怎么写 ajaxpro引用问题
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无标题页</title>
<script language ="javascript" >
window .onload = test;
function test()
{
if(document .getElementById ("Select1").options[0].selected)
{
document .getElementById ("t").readOnly = "readOnly" ;
}
if(document .getElementById ("Select1").options[1].selected)
{
document .getElementById ("t").readOnly = "" ;
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input type="text" id="t" />
<select id="Select1" onchange ="test();">
<option>正常</option>
<option>不正常</option>
</select>
<br />
</div>
</form>
</body>
</html>