Eventually I got this sorted out.
This is what I've done:
1 - Open WebResource.axd to the address of the 2 javascript used for validation. The adress can be found doing a view source in a page with validators.
You can find a nice walkthrough in http://support.microsoft.com/kb/931762
2 - Go to Webforms.js copied in the previous step and change the AllValidatorsValid(validators) method to perform the code. In my case I call a javascript method to display the error message.
The method looks like this now:
function AllValidatorsValid(validators) {
if ((typeof(validators) != "undefined") && (validators != null)) {
var i;
for (i = 0; i < validators.length; i++)
{
if (!validators[i].isvalid)
{
if(showValidationBox)
{
var text = '<span><b>ERROR:</b></span><br/><span>' + validators[i].errormessage + '</span>'
showValidationBox (document.getElementById(validators[i].controltovalidate).id, 'ErrorBox', 'ErrorBoxGhost', null, null, text, 200, 75)
}
return false;
}
else
{
hideValidationBox('ErrorBox', 'ErrorBoxGhost')
}
}
}
return true;
}
And that's that! One problem... I couldn't get this to work in pages with Microsoft Ajax, because this framework needs it own implementation of Webforms.js and I couldn't get it to search for the file where I want...
If you need any more details just tell me something.
Regards