|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-05-16 11:59 UTC] tony2001@php.net
[2005-05-24 01:00 UTC] pear-dev at lists dot php dot net
[2010-08-25 12:09 UTC] mansion@php.net
-Status: No Feedback
+Status: Closed
-Package: PEAR related
+Package: *General Issues
[2010-08-25 12:09 UTC] mansion@php.net
[2010-08-25 12:28 UTC] pajoye@php.net
-Status: Closed
+Status: Bogus
[2010-08-25 12:29 UTC] pajoye@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 21:00:01 2025 UTC |
Description: ------------ When I have a first select option that don't have second select option, then the rule failed to validate and submit the form values to process. Example When I select 'Argentina' (below), that don't have second options (because still he was not inserted in the database) then the hierselect load the second select empty, then I submit the form and the validate failed and process the form. Reproduce code: --------------- $main[0] = "Brasil"; $main[1] = "Argentina"; $secondary[0][0] = "Porto Alegre"; $secondary[0][1] = "Rio de Janeiro"; $form->setDefaults(array('location'=>array(0,1))); $sel =& $form->addElement('hierselect', 'location', 'Location:'); $sel->setMainOptions($main); $sel->setSecOptions($secondary); $form->addElement('submit', 'btnSubmit', 'Submit'); $form->addRule('location', 'Field Required', 'required'); if ($form->validate()) $form->process($function = 'insert', false); $form->display(); Expected result: ---------------- I expect that the rule break and return the message 'Field Required' to second element location too