[pLog-svn] validator help

Jon Daley plogworld at jon.limedaley.com
Tue Jan 24 04:22:37 GMT 2006


 	I want to validate the user typed in subdomains a couple of ways.

One, I want a simple check against the forbidden_usernames list.
And then I want to remove bad characters, and translate ones I can using 
the new domainize function. Then I want to run the forbidden_usernames 
list again.

I wrote a domainValidator that does what I want, and catches it if I type 
in directly "www (.domain.com)", but if I type in "www- (.domain.com)" it 
doesn't catch it, so then domainize strips the trailing -, and then my 
copied domainvalidator code into adminupdateblogsettingsaction catches the 
failure, and returns FALSE, out of the perform function.

But, the data has not been saved, and so *all* values on the page revert 
to what they were before I hit the submit button, which is annoying.

I basically just want to run the validator again, and have it put the 
error text next to the field that is wrong, and leave all other text the 
way the user just typed it in, so he doesn't have to retype it.

I have thought about making my domainvalidator call domainize and then 
check, but 1. I am not sure if that is possible, and 2. validators 
generally don't depend on lifetype code, though depending on textfilter 
isn't so bad.

Thoughts?

**************************************
Jon Daley
http://jon.limedaley.com/

All who would win joy, must share it; happiness was born a twin.
-- Lord Byron


More information about the pLog-svn mailing list