Validation ... |
[eluser]llbbl[/eluser]
http://ellislab.com/codeigniter/user-gui...ation.html Read everything on that page throughly. Try the examples. It helps. If you want set your own error message other than the default one use this: Code: $this->validation->set_message('required', 'Your custom message here'); That will change the error message for any field that is checking for the rule "required". Quote:required No Returns FALSE if the form element is empty. ................................ Ok so if you want to check for something else like if the field exists already in the database this is one way to do it. in a controller: - do the built in validation - if no errors w/ built in validation, call a function in some library - if field exists set $error = 'username' then return error - if field doesnt exist insert or whatever set $error = 'success' then return error - check value of error - if error = username Code: // basic controller junk |
Messages In This Thread |
Validation ... - by El Forum - 09-24-2007, 07:45 PM
Validation ... - by El Forum - 09-25-2007, 11:21 AM
Validation ... - by El Forum - 09-25-2007, 12:14 PM
Validation ... - by El Forum - 09-25-2007, 12:26 PM
Validation ... - by El Forum - 09-25-2007, 01:23 PM
Validation ... - by El Forum - 09-26-2007, 06:27 AM
Validation ... - by El Forum - 10-03-2007, 10:21 PM
Validation ... - by El Forum - 10-03-2007, 10:47 PM
Validation ... - by El Forum - 10-03-2007, 10:57 PM
|