• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule Reference for greater_than/less_than value checking with using callback

#1
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. 

$one-time-pay=10,000

$instalment_pay =12,000


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


Please help me.

Thanks



Code:
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'
                                                                      ),
                      ),



    );
Reply

#2
You posted in CI4 forums, but this looks like CI3 code. Which version are you targeting?
Support Development  • Practical CodeIgniter 3  • Vulcan - CLI Tools for CI4
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.