我目前正在使用PFBC framework来设置表单。我有一个小的结账表格,我需要发布(步骤1)。验证并发布后,表单重定向到下一页(步骤2)。
我想让客户在使用后退按钮(浏览器)时更改其表单输入。
不知怎的,我没有看到设法预先填充会话中的字段。表单类以表格形式定义:php
$form = new Form("question");
// Prevent bootstrap and jquery from re-loading, already loaded in doc head
$form->configure(array("prevent" => array("jQuery"), "view" => new View_SideBySide, "labelToPlaceholder" => 0));
$form->addElement(new Element_Hidden("form", "question"));
$form->addElement(new Element_HTML('<hr />'));
$form->addElement(new Element_Select("Type:", "type", $options, array("ID" => "type", "class" => "form-control", "required" => 1, "data-placeholder" => "Kies een type")));
$form->addElement(new Element_Textbox("Titel:", "title", array("ID" => "title", "class" => "form-control", "required" => 1, "placeholder" => "Geef hier een duidelijke titel op")));
$form->addElement(new Element_Button("Verstuur", "submit", array("ID" => "submit")));
$form->addElement(new Element_HTML('hr />'));
$form->render();
echo $id;
//----------AFTER THE FORM HAS BEEN SUBMITTED----------
if ($_POST["form"] == 'question') {
//ADDITIONELE VALUES
//UNSET VALUES THAT DONT BELONG IN THE DB
unset($_POST["form"]);
//ENTER DATA INTO DB
//$api->dbSave('application', $_POST);
//$id = mysql_insert_id();
//$_SESSION['formpost'] = $id;
//CLEAR VALUES AND REDIRECT
Form::clearValues("question");
header("location: " . $this->root . "next-page/step-2/");
}