Welcome Guest, Not a member yet? Register   Sign In
Form fill in
#1

[eluser]kjackson7_93[/eluser]
I'm new to CI... I've been using Smarty for my templating for a while but with CI's MVC I'd rather use good ole PHP in my views. To fill in a form (ie an edit form with text fields, selects, radio buttons, etc) with Smarty I use a plugin called "FillInFormValues". I'd like to use something similar in my views.

What's the best way to prepopulate a form with a variety of input types?
#2

[eluser]Chris Newton[/eluser]
http://ellislab.com/codeigniter/user-gui...ation.html

If you use the validation class, you can preset in the controller with:

this->validation->form_field="whatever"

Additionally, the validation class makes it easy to do some pretty advanced validation stuff with simple commands.
#3

[eluser]kjackson7_93[/eluser]
Thank for the quick reply! I wasn't particularly looking for validation, I was thinking more of an edit screen where I pull the info from a database and prepopulate the form... but this solution sounds like it will do my edit screen and a bonus of doing the validation too.

Thanks!
#4

[eluser]José Mota[/eluser]
[quote author="mahuti" date="1204666925"]http://ellislab.com/codeigniter/user-guide/libraries/validation.html

If you use the validation class, you can preset in the controller with:

this->validation->form_field="whatever"[/quote]

mahuti, so you're trying to say that we can actually set a default value into the inputs? Imagine you wanna edit a user that has already data filled in, a pretty common situation.

Thank you!
EDIT: question solved. My assumption was true.




Theme © iAndrew 2016 - Forum software by © MyBB