• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Form Validation with Array for fieldname

According to this, my form and validation should work

My form has form objects such as :

<input type="text" size="50" class="text" name="setting[client_name]" value="">

And my validate function includes :

$rules['setting[client_name]']    = "required";

$fields['setting[client_name]']    = 'Business Name';

But it errors even when a valid value exists in the post. How can I troubleshoot to insure that the fieldname being posted matches the fieldname being set in the validation rules/fields?

[eluser]daniel ispas[/eluser]

As far as i know you can't define validation rules that match the value of the field to a given string using the validation library included in CI. You could use a simple if statement or modify the validation class / create your own class.

sorry that makes no sense to me. I've been using CI for years now w/o issue. not sure why the validation config is not matching up to post values

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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