![]() |
set_value not re-populating textarea after validation fails - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: set_value not re-populating textarea after validation fails (/showthread.php?tid=15420) |
set_value not re-populating textarea after validation fails - El Forum - 02-04-2009 [eluser]tim1965[/eluser] Hi Can anyone confirm if they have set_value working correctly with Textarea´s. I have a couple of very complex forms, with lots of checkboxes, menus, etc. Everything is re-populating correclty when i re-display the form if validation fails. Except my textarea fields. I have validation rules set up correctly, but they dont seem to want to work. I have duble checked everything and they should work. I will post the relevant bits of code in the hope that somewill will eyeball them for me and see if they can see what i am missing. Controller validation rule $this->form_validation->set_rules('contactnotes', 'Contact Notes', 'trim|required|max_length[300]|alpha_dash_space'); view <label for="contactnotes">Your Telephone contact detials to be displayed </label> </div> <textarea name="contactnotes" id="contactnotes" cols="50" rows="6" class="countdown limit_300_" value="<?php echo set_value('contactnotes'); ?>" ></textarea> <br /><span class="phperror"><?php echo form_error('contactnotes'); ?></span> <span class="remaining"><!-- --></span> There is a little bit of javascript in there as well, but i dont think that is causing the problem. Thanks in advance. set_value not re-populating textarea after validation fails - El Forum - 02-04-2009 [eluser]Craig A Rodway[/eluser] Textarea tags don't have a value attribute - the value goes between the opening and closing tags: Code: <textarea name="contactnotes" id="contactnotes" cols="50" rows="6" class="countdown limit_300_"><?php echo set_value('contactnotes'); ?></textarea> set_value not re-populating textarea after validation fails - El Forum - 02-04-2009 [eluser]tim1965[/eluser] Aaaaaaaaaaaaaaaaaaaargh. Its always the obvious ones. Thank you Craig. |