CodeIgniter Forums
[CI4] Form validation with optional input - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: [CI4] Form validation with optional input (/showthread.php?tid=77612)



[CI4] Form validation with optional input - cybersven - 09-24-2020

Hi,

I have a form with data validation.
I have an optionnal input, with  a rule on it like 'min_length[3]' but if the user don't fill it, then the form will asked to enter at least 3 characters, how can I make it possible to apply the rule only when user fill it (I mean properly) ?


RE: [CI4] Form validation with optional input - paulbalandan - 09-24-2020

use permit_empty