[eluser]Bramme[/eluser]
Hi all,
I've got a weird problem with the form helper. I'm setting an array in my controller, which I use to build my form.
Code:
$data['form'] = array(
'hidden' => array(
'name' => 'tutID',
'value' => $tutID
),
'name' => array(
'name' => 'name',
'id' => 'name',
'value' => $this->validation->name
),
'password' => array(
'name' => 'password',
'id' => 'password'
),
'email' => array(
'name' => 'email',
'id' => 'email',
'value' => $this->validation->email
),
'message' => array(
'name' => 'message',
'id' => 'message',
'value' => $this->validation->message
),
'submit' => array(
'name' => 'submComment',
'value' => 'Submit'
)
);
And then in my view I use this:
Code:
<?=form_open($this->uri->uri_string().'#comments'),"\n"?>
<?=form_hidden($form['hidden']), "\n"?>
<p><label for="name">NAME <span class="small green">( required )</span><br />
<?=form_input($form['name'])?></p>
<p><label for="password">PASSWORD <span class="small green">( if you are a forum member )</span><br />
<?=form_password($form['password'])?></p>
<p><label for="email">EMAIL <span class="small green">( required, but won't be published )</span><br />
<?=form_input($form['email'])?></p>
<p><label for="message">MESSAGE <span class="small green">( required )</span><br />
<?=form_textarea($form['message'])?></p>
<p><?=form_submit($form['submit'])?></p>
</form>
However, the weird thing is, in my source code, I suddenly see this:
Code:
<input type="hidden" name="name" value="tutID" /><input type="hidden" name="value" value="192" />