an array in name field in a form? |
[eluser]ajsie[/eluser]
in the documentation it says that you can have an array in the name field. Code: <input type="text" name="options[]" value="<?php echo set_value('options[]'); ?>" size="50" /> but i dont get why u would do that. could someone explain?
[eluser]InsiteFX[/eluser]
Did you read this? Form Validation Look towards the bottom Using Arrays as Field Names. InsiteFX
[eluser]Clifford James[/eluser]
I use an array in my forms to group data (for different database tables), like an user and settings: Code: <input type="text" name="user[name]" /> I can now access only the user data very easily trough: Code: $this->input->post('user'); // array('name', => 'value', 'email' => 'value') And the settings Code: $this->input->post('user_settings'); // array('language' => 'value', 'group' => 'value')
|
Welcome Guest, Not a member yet? Register Sign In |