28 September 2011

ASP:RegularExpressionValidator force validation with JavaScript

Hi All,

You often have the situation when you want to force the validation of the ASP:RegularExpressionValidator using JavaScript.
This is usually because for some reason the Validator is not actioned automatically like: the submit button was initially disabled, or the value of the input to validate is changed through JavaScript.
So you can force the validation of the ASP:RegularExpressionValidator using the Page_ClientValidate JavaScript function.

26 September 2011

asp:RegularExpressionValidator not working for initially disabled buttons

Hi all,

I have found an interesting thing or better to say odd behaviour about asp:RegularExpressionValidator and the way it is actioned.

Below I will describe the odd behaviour:
For example you have a form and a field with a RegularExpressionValidator on that field and a asp:Button on that form. So if that button is disabled by default (through asp or in code-behind)  and then it is enabled through JavaScript then you will have a surprise - the RegularExpressionValidator will not be actioned.

The RegularExpressionValidator will work very good when button is disable by default and then is enabled through codebehind.

Conclusion:
Pay attention when disabling/enabling asp buttons through JavaScript.

22 September 2011

Some Relax

Hi all,

There has passed some time since I haven't posted anything, It's because I had some routine work to do and nothing interesting to post, no interesting solutions for the public. Today at work I have received an interesting image which made me laugh. It is about "Reasons why people who work with computers seem to have a lot of spare time". See below the image:

Need more? Leave comments and subscribe to my blog.

.