• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
need help for form_helper

#1
[eluser]mr.noname[/eluser]
Hello

I'm a newbie for CI for 2 days. CI is great!

but I need help.............

How can I define rows/cols for form_textarea() by do not modify this line

Code:
$defaults = array('name' => (( ! is_array($data)) ? $data : ''), 'cols' => '90', 'rows' => '12');

in this function

Code:
function form_textarea($data = '', $value = '', $extra = '')
{
    $defaults = array('name' => (( ! is_array($data)) ? $data : ''), 'cols' => '90', 'rows' => '12');
    
    $val = (( ! is_array($data) OR ! isset($data['value'])) ? $value : $data['value']);

    unset ($data['value']); // textareas don't use the value attribute
        
    return "<textarea ".parse_form_attributes($data, $defaults).$extra.">".$val."</textarea>\n";
}

again, I'm a newbie.
Thank you.

#2
[eluser]rogierb[/eluser]
try:

Code:
$textarea = array(    "name"    =>    "sometextarea",
            "rows"    =>    "10",
            "cols"    =>    "20"
         );


echo form_textarea($textarea)

But this is all documented in the user guide.
Look @ the form helper.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.