Welcome Guest, Not a member yet? Register   Sign In
Rule Reference for greater_than/less_than value checking with using callback

(This post was last modified: 06-11-2017, 11:33 PM by nkhan.)

Is there ny way to  greater_than/less_than  checking with using callback function in CI 3.0.

I have two fields about course fess. 


$instalment_pay =12,000

I want installment pay always will be greater than onetime payment.

Please help me.


public $rules = array(
                       'name' => array(
                                        'field'  => 'name',
                                        'label'  => 'Course',
                                        'rules'  => 'trim|required',
                                        'errors' => array(
                     'one_time_payment' => array(
                                        'field'  => 'one_time_payment',
                                        'label'  => 'Onetime Payment',
                                        'rules'  => 'trim|required|integer',
                                        'errors' => array(
                                                                          'required' =>"Please enter Onetime Pay Amount",
                    'installment_payment' => array(
                                        'field'  => 'installment_payment',
                                        'label'  => 'Installment Payment',
                                        'rules'  => 'trim|required|greater_than[one_time_payment').']');,
                                        'errors' => array(
                                              'required' =>"Please enter Installment Amount",
                                             'greater_than'=>'Plase enter some greater value than Onetime payment'


You posted in CI4 forums, but this looks like CI3 code. Which version are you targeting?

Theme © iAndrew 2016 - Forum software by © MyBB