CI 2.2 Form Validation not working as expected |
10-27-2015, 08:37 AM
(This post was last modified: 10-27-2015, 08:54 AM by joseph.dicdican. Edit Reason: code indention )
SRG,
I apologize bout the previous post, I didn't read it carefully. Now I got you somehow, you are using array for input Code: <form action="<?php echo base_url('test/index'); ?>" method="post"> I coded this on my local and had it running. PHP Code: public function index() In this part, I enclosed the index value of each opt with parenthesis "()" to obtain the integer value. The value of index depends on the arrangement of inputs on view page. Code: $config = array( If we write it merely like below, Code: $config = array( Additionally, based on what I just learned, we do not need to check if input is not null before setting validation rules, we can just set a validation rule directly without required in rules. This validates the specific field if it is not null. You can see the attachment what I got in my testing. By the way, I did not include the phone validation for this is just for testing. I hope this time this can help. Thank you. - joseph.dicdican
Joseph K. Dicdican
Softshore Global Solutions Inc. | Junior Web Developer Intern Passerelles numériques Philippines | Scholar [email protected] |
Messages In This Thread |
CI 2.2 Form Validation not working as expected - by SRGreenwood - 10-18-2015, 07:29 AM
RE: CI 2.2 Form Validation not working as expected - by PaulD - 10-18-2015, 06:56 PM
RE: CI 2.2 Form Validation not working as expected - by Avenirer - 10-18-2015, 11:48 PM
RE: CI 2.2 Form Validation not working as expected - by SRGreenwood - 10-21-2015, 12:37 PM
RE: CI 2.2 Form Validation not working as expected - by Avenirer - 10-27-2015, 01:21 PM
RE: CI 2.2 Form Validation not working as expected - by joseph.dicdican - 10-26-2015, 11:50 PM
RE: CI 2.2 Form Validation not working as expected - by SRGreenwood - 10-27-2015, 03:32 AM
RE: CI 2.2 Form Validation not working as expected - by joseph.dicdican - 10-27-2015, 08:37 AM
|