Welcome Guest, Not a member yet? Register   Sign In
form sends $_post for input but not for textarea
#1

[eluser]ingrimm[/eluser]
Hi guys,
i've just started using CI, so please bear with me if i get some basics wrong :-)

i have a view with a form and a few input fields and one textarea in it. on postback i get the values for the input fields but not for the textarea... what am i doing wrong:



PHP View:
Code:
<?php $attributes = array('class' => 'validate', 'id' => 'sendmail'); ?>
                    <?=form_open('members/request', $attributes)?>
                            
                    <p>Name:</p>&lt;input type="text" name="nachname"&gt;
                        <p>Vorname:</p>&lt;input type="text" name="vorname"&gt;
                        <p>Telefonnummer:</p>&lt;input type="text" name="telefon" id="telefon"&gt;
                        <p>Email Adresse:</p>&lt;input type="text" name="email" id ="email"&gt;
                        &lt;?php $textarea_data = array('id' => 'description',
                       'name' => 'description',
                       'rows' => 5,
                       'cols' => 50);?&gt;
                        <p>Anliegen:</p>&lt;?=form_textarea($textarea_data);  ?&gt;
                        <br/>
                        
                    <button type="submit" class="save" ></button>
                </div>&lt;!-- End employee-add--&gt;
                    &lt;/form&gt;

HTML Output:


Code:
&lt;form name="request" id="sendmail" class="validate" method="post" action="http://localhost/test/members/request"&gt;                            
                    <p>Name:</p>&lt;input type="text" name="nachname" class="valid"&gt;
                        <p>Vorname:</p>&lt;input type="text" name="vorname" class="valid"&gt;
                        <p>Telefonnummer:</p>&lt;input type="text" id="telefon" name="telefon" class="valid"&gt;
                        <p>Email Adresse:</p>&lt;input type="text" id="email" name="email" class="valid"&gt;
                                                <p>Anliegen:</p>&lt;textarea id="description" rows="5" cols="50" name="description" class="valid"&gt;&lt;/textarea>
                        <br>
                        
                    <button class="save" type="submit"></button>
                &lt;/form&gt;

and this is the firebug output:

Parameter application/x-www-form-urlencoded
email klmlkm
nachname lklkm
telefon lkmlkm
vorname lkmlkm
Source
nachname=lklkm&vorname=lkmlkm&telefon=lkmlkm&email=klmlkm


the post entry for the textarea is completely missing...

any ideas ?

thanks in advance

Michael
#2

[eluser]ram4nd[/eluser]
you have to include the form helper
#3

[eluser]ingrimm[/eluser]
no that's not it, the form helper has already been included as autoload config. otherwise the form generation:

&lt;?=form_open('members/request', $attributes)?&gt;

would not work either, right?
#4

[eluser]ram4nd[/eluser]
use correct php tags. The problem is that you have ; at the end
#5

[eluser]ingrimm[/eluser]
geez... the problem wasn't even CI related at all. After disabling almost everything including my js library's i discovered that jquery's deserializeArray() method has not been introduced to textareas. It was just told to use input and select elements.

Thats what you get for using other people's code and not understanding it :-) Thanks anyways.




Theme © iAndrew 2016 - Forum software by © MyBB