Issue
I have the below Conditional Validation, this validation only check the cc_number when the payment_method_id is 1, so it should not validate when there is other payment_method_id being used, but problem in my view page, even if I dont select the payment method, the form will not submit to the controller, unless the cc_number is filled, is there anyway to disable this cc_number check ? thank you
$validator->creditCard ( 'cc_number', [ 'mc','visa' ], __ ( 'invalid card number' ), function ($context)
{
if ($context ['data'] ['payment_method_id'] == 1)
return true;
} );
Solution
sorry for wasting space in this area, i just code cakephp3.5 recently, seems that this problem can be easily solve by putting ,'novalidate' => true at the $this->Form->create method
Answered By - cakephp_dev1
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.