Bug #25360 [Com]: hierselect failed in the validate
| From: | lildurk25360 at gmail dot com | Date: | Wed, 01 Sep 2021 18:52:50 +0000 |
| Subject: | Bug #25360 [Com]: hierselect failed in the validate | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-236334@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=25360&edit=1
ID: 25360
Comment by: lildurk25360 at gmail dot com
Reported by: cristianoarnold at yahoo dot com dot br
Summary: hierselect failed in the validate
Status: Not a bug
Type: Bug
Package: *General Issues
Operating System: Windows 2000
PHP Version: Irrelevant
Assigned To: mansion
Block user comment: N
Private report: N
New Comment:
Lil Durk is a private agency dedicated to providing responsible access to legal cannabis for adults
aged 19 and older. Weâre an exclusively online retailer and wholesaler for recreational
cannabis and a trusted source for information about cannabis and cannabis-related issues. We believe
our work is meaningful and we take pride in our mandate to promote the socially responsible use of
legal cannabis. https://lildurk.com/
Previous Comments:
------------------------------------------------------------------------
[2010-08-25 12:29:00] pajoye@php.net
Please use pear.php.net to report pear packages bugs.
------------------------------------------------------------------------
[2010-08-25 12:09:12] mansion@php.net
This is the expected behavior. If you want more complex rules, use addGroupRule or
addFormRule.
------------------------------------------------------------------------
[2005-05-24 01:00:05] pear-dev at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2005-05-16 11:59:35] tony2001@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
------------------------------------------------------------------------
[2003-09-02 08:13:01] cristianoarnold at yahoo dot com dot br
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
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=25360&edit=1