Welcome Guest, Not a member yet? Register   Sign In
How do I add a custom rule for form validation?
#1

[eluser]dallen33[/eluser]
I'm building a registration form, and when the form submits, I want it to check to see if the username exists. Right now, I'm doing it with a AJAX call that returns "username exists" or "username okay" while the user is typing. But I also want to check it while I'm validating.

Code:
$this->form_validation->set_rules('username', 'Username', 'required');

So I have 'required', but how could I also add something like 'username_check'? How would I go about this? I read the user guide but I can't seem to figure it out.
#2

[eluser]dallen33[/eluser]
Ah shoot. I didn't scroll down to Callbacks. Ignore this post! I apologize.
#3

[eluser]Luis Perez[/eluser]
You can extend the form validation class too




Theme © iAndrew 2016 - Forum software by © MyBB