Can't set customer form error |
Hello,
I want to set a customer error message. Can anyone tell me why this doesn't it appear? Thanks, James PHP Code: $this->form_validation->set_rules('username', 'Username', 'trim|required|xss_clean'); (03-07-2018, 01:52 PM)randomhacks Wrote: Hello, Just a quick look and im no expert but "$this->form_validation->set_message" I use when creating a custom validation rule? to see the error messages on the form after submit is thats what you looking for i do this in my controller / model $this->data[ 'submiterrorms' ] = validation_errors( '<p class="error_msg">', '</p>' ); and then have tis in my view <?php if (! empty($submiterrorms)) { ?> <?php echo $submiterrorms; ?> <?php } ?> or you can just use <?php echo validation_errors(); ?>
You need to validate the login with a callback.
https://www.codeigniter.com/user_guide/l...on-methods You can modify mine if you want. PHP Code: public function login() |
Welcome Guest, Not a member yet? Register Sign In |