-
Notifications
You must be signed in to change notification settings - Fork 16
Closed
Description
When using a regular isSubmitted() check, it validates against a newly generated form name when no form name is specified.
Example form:
use ValidFormBuilder\ValidForm;
require '../vendor/autoload.php';
$objForm = new ValidForm();
//*** The area and select are not required to reproduce the issue.
$objArea = $objForm->addArea("Area label", true, "active-area", false);
$objAreaSelect = $objArea->addField("area-select", "Area select label", ValidForm::VFORM_SELECT_LIST,
array(
"required" => false
)
);
$objAreaSelect->addField('value1','id1');
$objAreaSelect->addField('value2','id2');
//*** Generate form output
if ($objForm->isValid() && $objForm->isSubmitted()) {
$strOutput = $objForm->valuesAsHtml();
} else {
$strOutput = $objForm->toHtml();
}Quick and easy but API breaking fix: make form name required. What do you think @flangfeldt? Can we make the form's name required?
Reactions are currently unavailable