CodeIgniter Forums
help with form_input() - 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: help with form_input() (/showthread.php?tid=53704)



help with form_input() - El Forum - 08-04-2012

[eluser]sanguina[/eluser]
The documentation says that to populate form field with form_input() - use:

'value' => 'enter your login id', in the array.

Also to repopulate fields in case of error in entry - we are supposed to do:

'value' => set_value('login'),

I basically want to do both -

i;e - before the user enters anything - the form field should display - "enter your user id" but supposedly he enters wrong details - the form should then be repopulated with the entered data.

How to do this ? thanks


help with form_input() - El Forum - 08-04-2012

[eluser]CroNiX[/eluser]
read about the 2nd parameter to set_value() Smile


help with form_input() - El Forum - 08-04-2012

[eluser]xtremer360[/eluser]
With html5 there's an attribute called placeholder that you might want to look into.


help with form_input() - El Forum - 08-05-2012

[eluser]sanguina[/eluser]
thanks set_value()2nd parameter worked..