ajax form field validation in yii
So I have a User model and when someone goes to create a user, I want the username field to turn green if it isn't a duplicate username in the DB and red otherwise stating that duplicate usernames are not allowed. Is there a way to do this with the framework or does this have to be done from scratch?
I imagine the easiest route would be to create a validation function on the user model which looks it up and returns true or false.
You can then use the usual and well documented methods of setting up a model-form with AJAX validation, and specify username must pass your new validation rule.
If you need more assistance edit your question to give some sense of how far you've get with this, level of knowledge currently and some code if there's something breaking.