Search code examples
codeignitertextareavalidationsetvalue

Textarea using set_value not populated Codeigniter


i have a simple form in my view that has a text area :

<textarea name="description" value="<?php echo   set_value('description'); ?>"></textarea>

in my controller i have validated this text area using form_validation library

$this->form_validation->set_rules('description', 'Description', 'trim|required');

the validation is working perfectly , ie it gives me the error if text area is blank , but it does not repopulate the textarea , if textarea-description is correctly filled but there is some error in the other fields

What am i doing wrong ?


Solution

  • Textarea doesn't have a value attribute.

    <textarea name="description"> 
          <?php echo set_value('description'); ?> 
    </textarea>