Added support to reuse form data if validation fails, refs #672
This commit is contained in:
@@ -39,5 +39,14 @@ function makeyesno($name, $yesvalue, $novalue = '', $yesselected = '', $disabled
|
||||
} else {
|
||||
$d = '';
|
||||
}
|
||||
return '<select class="dropdown_noborder" id="' . $name . '" name="' . $name . '"'.$d.'><option value="' . $yesvalue . '"' . ($yesselected ? ' selected="selected"' : '') . '>' . $lng['panel']['yes'] . '</option><option value="' . $novalue . '"' . ($yesselected ? '' : ' selected="selected"') . '>' . $lng['panel']['no'] . '</option></select>';
|
||||
|
||||
if (isset($_SESSION['requestData'])) {
|
||||
$yesselected = $yesselected & $_SESSION['requestData'][$name];
|
||||
}
|
||||
|
||||
return '<select class="dropdown_noborder" id="' . $name . '" name="' . $name . '"'
|
||||
.$d.'>
|
||||
<option value="' . $yesvalue . '"' . ($yesselected ? ' selected="selected"' : '') . '>'
|
||||
. $lng['panel']['yes'] . '</option><option value="' . $novalue . '"'
|
||||
. ($yesselected ? '' : ' selected="selected"') . '>' . $lng['panel']['no'] . '</option></select>';
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
function standard_error($errors = '', $replacer = '')
|
||||
{
|
||||
global $db, $userinfo, $s, $header, $footer, $lng;
|
||||
$_SESSION['requestData'] = $_POST;
|
||||
$replacer = htmlentities($replacer);
|
||||
|
||||
if(!is_array($errors))
|
||||
|
||||
Reference in New Issue
Block a user