CodeIgniter Forums
Help with form helpers - 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 helpers (/showthread.php?tid=27731)



Help with form helpers - El Forum - 02-18-2010

[eluser]NachoF[/eluser]
Is there a way I can change to way form helpers behave?? I understand they can receive parameters for extra attributes but the only extra functionality I want is having them set the id of the form element to be the same as the name attribute

so for example I want
Code:
form_input("login")
to output
Code:
<input type="text" name="login" id="login" value=""  />



Help with form helpers - El Forum - 02-18-2010

[eluser]jbreitweiser[/eluser]
You can extend helpers.

http://ellislab.com/codeigniter/user-guide/general/helpers.html

Copy the functions you want to override and add code to add the id tag.


Help with form helpers - El Forum - 02-19-2010

[eluser]flaky[/eluser]
http://ellislab.com/codeigniter/user-guide/helpers/form_helper.html

go to form_input