Welcome Guest, Not a member yet? Register   Sign In
form_hidden()
#1

[eluser]halwaraj[/eluser]
Hi,

I am using the following Function:
Code:
form_hidden()
.

The problem is, the above statement is producing multiple tags.

If I do the following in the view file:

Code:
$hidden = array(
                'name'      => 'hiddenStory',
                'id'        => 'hiddenStory',
                'value'     => '',
            );


            echo form_hidden( $hidden );

It generates the following
Code:
<input name="name" value="hiddenLund" type="hidden">
<input name="id" value="hiddenLund" type="hidden">
<input name="value" value="" type="hidden">

What might be wrong?


Also, when I comment out the "echo form_hidden( $hidden );"

None of the above 3 tags are created
#2

[eluser]cahva[/eluser]
It does what it supposed to be. If you have an array, it will create multiple hidden fields. So do just:
Code:
echo form_hidden('hiddenStory','');

form_hidden function does not support extra properties so you cannot give it id. If youre planning to populate it with javascript, you can use getElementByName instead of getElementById.
#3

[eluser]halwaraj[/eluser]
oh is it? / / /

What happens in the case of form_input?
#4

[eluser]cahva[/eluser]
RTFM Smile Really, the userguide is quite clear.
#5

[eluser]halwaraj[/eluser]
oh right. Thanks alot.




Theme © iAndrew 2016 - Forum software by © MyBB