Welcome Guest, Not a member yet? Register   Sign In
Validating groups of inputs
#2

[eluser]Ihab Khattab[/eluser]
what I understand you have problem in setting rules for select

for example if your markup for select something like

Code:
<select name="coor-sys">

<option value="dec">Decimal latitude / longitude</option>
<option value="grid">Grid reference</option>
<option value="Lat/long">Latitude / longitude</option>

</select>

you should write something like

Code:
$config = array(
               array(
                     'field'   => 'locationName',
                     'label'   => 'Location name',
                     'rules'   => 'required'
                  ),
               array(
                     'field'   => 'locationDescription',
                     'label'   => 'Location description',
                     'rules'   => 'required'
                  ),
               array(
                   'field'   => 'coor-sys',
                   'label'   => 'Coordination system',
                   'rules'   => 'required'
               )
            );
$this->form_validation->set_rules($config);

I modified the code you provide as I think it won't work. for more example about passing rules as an array you may check
http://ellislab.com/codeigniter/user-gui...lesasarray


Messages In This Thread
Validating groups of inputs - by El Forum - 07-27-2010, 07:43 AM
Validating groups of inputs - by El Forum - 07-27-2010, 02:24 PM
Validating groups of inputs - by El Forum - 07-28-2010, 07:44 AM
Validating groups of inputs - by El Forum - 07-28-2010, 10:13 AM
Validating groups of inputs - by El Forum - 07-29-2010, 02:41 AM
Validating groups of inputs - by El Forum - 07-29-2010, 05:12 AM
Validating groups of inputs - by El Forum - 07-29-2010, 05:40 AM
Validating groups of inputs - by El Forum - 07-29-2010, 06:16 AM
Validating groups of inputs - by El Forum - 07-29-2010, 06:46 AM
Validating groups of inputs - by El Forum - 07-29-2010, 07:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB