我想在VS2005中实现修改后按纽变可用,用下面的程序不行,请帮忙,好久没有用了我在ASPX中写了
function ValueChanged()
{
document.getElementById('Button2').disabled=false;
}
在页中改了
<asp:TextBox ID="tclient" runat="server" Style="z-index: 110; left: 128px; position: absolute;
top: 72px" Width="416px" OnTextChanged="ValueChanged();" ></asp:TextBox>错在哪儿?谢谢!
function ValueChanged()
{
document.getElementById('Button2').disabled=false;
}
在页中改了
<asp:TextBox ID="tclient" runat="server" Style="z-index: 110; left: 128px; position: absolute;
top: 72px" Width="416px" OnTextChanged="ValueChanged();" ></asp:TextBox>错在哪儿?谢谢!
不是客户端js的
将
OnTextChanged="ValueChanged();"
改成
onPropertyChange="ValueChanged()"
就可以了可能VS会提出警告
<asp:TextBox ID="tclient" runat="server" Style="z-index: 110; left: 128px; position: absolute;
top: 72px" Width="416px" OnChanged="ValueChanged();" > </asp:TextBox>
方法1
<asp:TextBox ID="tclient" runat="server" Style="z-index: 110; left: 128px; position: absolute;
top: 72px" Width="416px" OnChange="ValueChanged();" > </asp:TextBox> 方法2
也可以
<asp:TextBox ID="tclient" runat="server" Style="z-index: 110; left: 128px; position: absolute;
top: 72px" Width="416px" > </asp:TextBox> protected void Page_Load(object sender, EventArgs e)
{
tclient.Attributes.Add("onchange", "ValueChanged()");
}