If I dont disable the button in page load, it works fine.
Any help will be greatly appreciated.
Here is Page_Load:
btn.Enabled =
false;text1.Attributes.Add(
"onchange", "document.form1.btn.disabled=false;");And this is the aspx page:
<form id="form1" runat="server"> <asp:ValidationSummary ID="vsImportExclusions" runat="server" ValidationGroup="import" /> <asp:TextBox ID="text1" runat="server">asp:TextBox> <asp:RequiredFieldValidator ID="rtext1" ControlToValidate="text1" runat="server" ErrorMessage="ERROR" ValidationGroup="import" Display="None">asp:RequiredFieldValidator> <asp:Button ID="btn" Text="OK" runat="server" ValidationGroup="import" /> form>
PHANI NADIGADDAPosted Feb 2, 2007, 12:22 PM
Use the following JavaScript code along with your js code when you add an attribute.
event.returnValue = false;
event.cancel = true;
ALL THE BEST.