Forum Moderators: coopster

Message Too Old, No Replies

PEAR::quickForm pre-populate values

Pear quickform

         

Frasnko

6:17 am on Apr 11, 2007 (gmt 0)

10+ Year Member



In the spirit of challenging myself, I am building a content management system using as much object oriented programming as I can (since i have avoided it in the past). Part of this involves making use of the PEAR classes which are great. I really like quickForm, but it has been kind of hard for me to figure out how to get it to do what i want it to (like upload files or integrating with Smarty)!

I have spent most of my time searching for answers, but I have not been able how to figure out how to pre-populate the form values (on a page where the user would be editing some info from the database).

Does anyone have any experience with this?

Many thanks (in advance) to anyone who has anything to offer...

coopster

12:45 am on Apr 14, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



You should be able to just print the value from the table column into your <input value=""> attribute.

<input name="firstName" type="text" value="<?php print htmlentities($row['firstNameColumnFromDatabaseTable']); ?>">