G
Guest
I have a textbox in a webform which is validated by a compare validator. Also the textbox has autopostback property set to true. When I work this way, the page immediately posts back, thus the validator has no effect
So I tried to work it this way. I set the Autopostback=false and then in the page load event I wrot
textbox1.Attributes.Add("onchange", "javascript:if((typeof(Page_ClientValidate) == 'function') && Page_ClientValidate())" + Me.GetPostBackEventReference(textbox1, "")
I also have an image button on the form. When I use the above code, and when the page shows validation error message, I will have to click the imagebutton twice to perform an action. When there is no validation error, it works with single click. Is there a way to get around this without having the user to click the imagebutton twice when the page shows validation error
Thanks.
So I tried to work it this way. I set the Autopostback=false and then in the page load event I wrot
textbox1.Attributes.Add("onchange", "javascript:if((typeof(Page_ClientValidate) == 'function') && Page_ClientValidate())" + Me.GetPostBackEventReference(textbox1, "")
I also have an image button on the form. When I use the above code, and when the page shows validation error message, I will have to click the imagebutton twice to perform an action. When there is no validation error, it works with single click. Is there a way to get around this without having the user to click the imagebutton twice when the page shows validation error
Thanks.