I have a server side textbox on my page that has an OnBlur event that calls a vbscript function which validates the textbox (checks for a valid date) when the user leaves the control. If the date is not valid it shows a message and empties the contents of the textbox. The vbscript is registered in my page_Onload. When the page first loads this works fine, but after a postback to the server I get an error saying 'Object required Text1' , almost as if when the page is posted back it loses reference to my textBox. Does anyone have any idea why?
Thanks in advance for any help with this
Kurt
<asp:comparevalidator id="MyDateValidator" Runat="server" Operator="DataTypeCheck" Type="Date" Display="Dynamic" ErrorMessage="Please enter valid date" ControlToValidate="txtDate"></asp:comparevalidator>
As to why it's not working after postback..
Check the source of the page and see the name of the object is there and it's the same as what you are referencing in your vbscript function.
HTH,
Suresh.
----- Kurt wrote: -----