Closed GoogleCodeExporter closed 8 years ago
You can use the setValues function before you invoke the render function to
pre-fill the form's default values. The setValues function accepts an
associative array where the array's keys match the form element names. Below
is a code snippet that should get your headed in the right direction.
$form = new form("myexample');
$form->setAttributes(array(
"width" => "400"
));
$form->setValues(array(
"mytextbox" => "My Textbox's Value",
"mydate" => date("F j, Y")
))
$form->addTextbox("My Textbox:", "mytextbox");
$form->addDate("My Date:", "mydate");
$form->addButton();
$form->render();
Original comment by ajporterfield@gmail.com
on 4 Sep 2010 at 5:49
Original comment by ajporterfield@gmail.com
on 10 Sep 2010 at 1:38
Original issue reported on code.google.com by
herrmast...@mailinator.com
on 4 Sep 2010 at 4:37