Posts

Showing posts from October, 2009

ASP.NET CustomValidator - Changing error message at client side

The ASP.NET CustomValidator server control is very useful because it allows me to write my own validation logic with a few tweak to the settings and a few lines of codes. Not only it will provide server side validation, but it's able to do client-side validation as well. Furhter information about this can be found on MSDN website. The only problem that I have, is that I was not able to change the error message based on validation rules that I set at the client-side validation script. I tried to search on the Internet, and all I came across are either setting the source.errormessage, or the source.innerText attributes. Yet, none of them work for me, and I can't even find anything on MSDN that mentioned about this. So, applying some 'investigating' mind here, I tried to check what will CustomValidator be represented with, and it's represented by a <span> tag. Then, I tried to see if there's any value that I could retrieve in the client-side script by wr