Welcome Guest, Not a member yet? Register   Sign In
Form Validation
#4

Something like this:

$this->form_validation->set_rules('inp', 'Foo', 'required');
$this->form_validation->set_rules('inp[]', 'Bar', 'required');

Though, I don't understand everybody's obsession with making their inputs arrays ...

If you want to receive an undefined count of inputs - you don't need to require at least one.
If one is mandatory and more are optional; then the first is not the same as the optional ones - use two separate inputs.
If you're trying to do 'user[name]' when 'user_name' works perfectly fine, then you're just doing it wrong. Smile
Reply


Messages In This Thread
Form Validation - by coldlamper - 04-06-2016, 06:52 AM
RE: Form Validation - by Narf - 04-06-2016, 09:23 AM
RE: Form Validation - by coldlamper - 04-06-2016, 09:32 AM
RE: Form Validation - by Narf - 04-06-2016, 09:51 AM
RE: Form Validation - by albertleao - 04-06-2016, 08:00 PM
RE: Form Validation - by coldlamper - 04-07-2016, 07:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB