Welcome Guest, Not a member yet? Register   Sign In
weird problem with form helper
#1

[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&nbsp;&nbsp;<span class="small green">( required )</span><br />
    &lt;?=form_input($form['name'])?&gt;</p>
    <p><label for="password">PASSWORD&nbsp;&nbsp;<span class="small green">( if you are a forum member )</span><br />
    &lt;?=form_password($form['password'])?&gt;</p>
    <p><label for="email">EMAIL&nbsp;&nbsp;<span class="small green">( required, but won't be published )</span><br />
    &lt;?=form_input($form['email'])?&gt;</p>
    <p><label for="message">MESSAGE&nbsp;&nbsp;<span class="small green">( required )</span><br />
    &lt;?=form_textarea($form['message'])?&gt;</p>
    <p>&lt;?=form_submit($form['submit'])?&gt;</p>
&lt;/form&gt;

However, the weird thing is, in my source code, I suddenly see this:
Code:
&lt;input type="hidden" name="name" value="tutID" /&gt;&lt;input type="hidden" name="value" value="192" />


Messages In This Thread
weird problem with form helper - by El Forum - 07-20-2008, 04:48 AM
weird problem with form helper - by El Forum - 07-20-2008, 09:08 AM
weird problem with form helper - by El Forum - 07-20-2008, 09:22 AM
weird problem with form helper - by El Forum - 07-20-2008, 09:44 AM
weird problem with form helper - by El Forum - 07-20-2008, 09:48 AM



Theme © iAndrew 2016 - Forum software by © MyBB