Flourish PHP Unframework
This is an archived copy of the forum for reference purposes

Best way to repopulate a form after an error or update request

posted by anonymous 9 years ago

self explanatory

Check out:

The manage page handles the business logic and the add/edit page handles re-populating the form.

posted by wbond 9 years ago

What about select, checkbox, radio tags?

posted by anonymous 9 years ago

Check out fHTML#SelectOptionsandCheckboxes for examples of fHTML::showChecked() and fHTML::printOption(). Just pass data from the record object to those methods.

posted by wbond 9 years ago

Is there a security problem, this way ? (fRequest direct in the input value)

register.php :

$validator = new fValidation();
try {} catch {}
include '/../views/register.php';
#!text/html
<form method="post" action="register.php">
   <input type="text" name="email" value="<?php echo fRequest::encode('email') ?>" />
   (...)
</form>
posted by gill 8 years ago

i dont believe so... and this is how i do it... just make sure you handle it going into the DB.

posted by darren 8 years ago

That is fine from a security perspective. You just need to use either fTemplating::encode(), fRequest::encode(), fHTML::encode() or $active_record->encodeColumnName().

posted by wbond 8 years ago