Reputation: 9
I have this code:
$this->form_validation->set_rules('pay', '', 'required', array("required" => "this field is required"));
I neet to change to validate greater than 0.
Like this:
$this->form_validation->set_rules('pay', '', 'greater_than', array("greater_than" => "only values greater than 0"));
How can I do that?
Upvotes: 0
Views: 6560
Reputation: 1030
you only need to add that rule like
$this->form_validation->set_rules('pay', '', 'required| greater_than[0]');
Upvotes: 2