Welcome Guest, Not a member yet? Register   Sign In
problem learning CI
#19

[eluser]ntheorist[/eluser]
fyi, a nice way to handle forms is to name each of the fields by array vs individually, so instead of

<input name="name" type="text">
<input name="email" type="text">
<input name="address" type="text">

and having to use $this->input->post() on each, you use

<input name="form[name]" type="text">
<input name="form[email]" type="text">
<input name="form[address]" type="text">

and in your controller use $this->input->post('form'); It will contain the entire array from the form and can be validated easliy and sent directly to the model. For model forms typically i use this and name the form according to model, ie $user_data = $this->input->post('user',TRUE);

glad you got it to work tho

n


Messages In This Thread
problem learning CI - by El Forum - 07-14-2009, 01:54 AM
problem learning CI - by El Forum - 07-14-2009, 02:14 AM
problem learning CI - by El Forum - 07-14-2009, 02:24 AM
problem learning CI - by El Forum - 07-14-2009, 04:21 AM
problem learning CI - by El Forum - 07-14-2009, 08:51 PM
problem learning CI - by El Forum - 07-14-2009, 09:48 PM
problem learning CI - by El Forum - 07-15-2009, 01:08 AM
problem learning CI - by El Forum - 07-15-2009, 01:21 AM
problem learning CI - by El Forum - 07-15-2009, 01:22 AM
problem learning CI - by El Forum - 07-15-2009, 09:37 PM
problem learning CI - by El Forum - 07-15-2009, 09:40 PM
problem learning CI - by El Forum - 07-15-2009, 09:40 PM
problem learning CI - by El Forum - 07-15-2009, 09:57 PM
problem learning CI - by El Forum - 07-15-2009, 10:03 PM
problem learning CI - by El Forum - 07-15-2009, 11:11 PM
problem learning CI - by El Forum - 07-16-2009, 01:11 AM
problem learning CI - by El Forum - 07-16-2009, 03:51 AM
problem learning CI - by El Forum - 07-16-2009, 04:17 AM
problem learning CI - by El Forum - 07-16-2009, 04:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB