Hi,
I've developed a user plugin which carries out some validation on registration and on update.
The validation is working fine, but I am seeing 2 issues which I wondered if anybody else had experienced..
1. When a field is set to required, if it fails to validate correctly then I get my javascript error displayed but the field isn't turned red. I think this is because after the user validation test, there is a builtin check for required fields which sets the background back to normal if the field is present therefore overriding my change.
2. For non-required fields, if I turn the field red because it fails validation, after I input the correct value, the background isn't reset.
See below for an example of my code..
[code:1]$this->_addValidationJS( "\tif (me.value > 100) {\n"
."\t errorMSG += \"".html_entity_decode($error_percar)."\\n\"\n"
."\t me.style.background = \"red\";\n"
."\t iserror=1;\n"
."\t}\n"«»);[/code:1]
Any suggestions gratefully received..
Cheers
John