php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25360 hierselect failed in the validate
Submitted: 2003-09-02 08:13 UTC Modified: 2010-08-25 12:28 UTC
Votes:6
Avg. Score:4.7 ± 0.7
Reproduced:5 of 5 (100.0%)
Same Version:2 (40.0%)
Same OS:3 (60.0%)
From: cristianoarnold at yahoo dot com dot br Assigned: mansion (profile)
Status: Not a bug Package: *General Issues
PHP Version: Irrelevant OS: Windows 2000
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: cristianoarnold at yahoo dot com dot br
New email:
PHP Version: OS:

 

 [2003-09-02 08:13 UTC] 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


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-05-24 01:00 UTC] 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".
 [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
This is the expected behavior. If you want more complex rules, use addGroupRule or 
addFormRule.
 [2010-08-25 12:28 UTC] pajoye@php.net
-Status: Closed +Status: Bogus
 [2010-08-25 12:29 UTC] pajoye@php.net
Please use pear.php.net to report pear packages bugs.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 04:01:29 2024 UTC