Welcome Guest, Not a member yet? Register   Sign In
Question About Validation Class


I know you can set rules to the validation class as such:

$rules['item_name'] = "trim|alpha"

and so forth

WHat i need to have is a field that allows alpha_dash, and allow the bracket symbols ().But the only way i can get the brackets in is alpha or alpha_numeric but then the alpha_dash doesnt work correctly

any ideas?



[eluser]Colin Williams[/eluser]
Do a custom callback method.

Yeh i thought of that, but then would you check the rules the exact same way ??

Also, in the custom error fields say:

$fields['zip'] = "Zip Code";

Codeigniter adds its own message to the end so the output of the error would read something like

Zip Code field may only contain alpha-numeric characters.

How do i prevent code igniter adding "field may only contain alpha-numeric characters." to the end so its a completely custom error message. $this->validation->set_message ( "zip", "bla bla" ) does nothing!

[eluser]Colin Williams[/eluser]
The set_message method needs the name of the callback method as the first param, not the name of the field.

Theme © iAndrew 2016 - Forum software by © MyBB