Welcome Guest, Not a member yet? Register   Sign In
Form validation custom message

I'm using a Rule group for my form validation but I need a custom message for one of the rule. I tried looking through the documentation but nothing was mentioned about this type of use-case. Could anyone help me out on how to go about this: Form Validation -> Rule Group -> Custom Message

Attached Files Thumbnail(s)

$this->form_validation->set_message() ought to do the trick.

Form Library provides set_message() method to set message on validate rule, even run CI native rule or custom created rule, see below example

PHP Code:
# required is rule name
# 2nd param for custom message and "%s" for field name.
$this->form_validation->set_message('required''%s required'); 
Passionate PHP Programmer & Codeigniter Developer :- Always happy to help you!

Theme © iAndrew 2016 - Forum software by © MyBB