Home » HTML » HTML_QuickForm » Bug #7470
$form->Validate() == true after succesful $form->SetElementError() call
Details
| Submitted | 2006-04-24 11:02 UTC |
|---|---|
| From | ben dot lancaster at design-ontap dot co dot uk |
| Assigned | avb |
| Status | Closed |
| Package | HTML_QuickForm |
| PHP Version | 4.4.1 |
| OS | FC4 |
| Roadmaps | (Not assigned) |
Comments
[2006-04-24 11:02 UTC] ben dot lancaster at design-ontap dot co dot uk
Description:
------------
Validate() still returns true even after SetElementError() has been succesfully applied to an element.
Suggest adding an additional flag to the SetElementError() method to indicate whether the error set should force Validate() to fail.
Test script:
---------------
<?php
$form = new HTML_QuickForm;
$form->addElement('text','field','This field should fail:');
if($form->isSubmitted())
$form->setElementError('field','Sorry, that field is invalid');
if($form->Validate())
echo 'validated';
else
echo 'not validated';
?>
Expected result:
----------------
not validated
Actual result:
--------------
validated