Re: Forms, ListBoxes, Validating Errors.
| From: | Richard Davey | Date: | Fri, 16 Jan 2004 11:43:02 +0000 |
| Subject: | Re: Forms, ListBoxes, Validating Errors. | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-174776@lists.php.net to get a copy of this message | ||
Hello Kacey,
Friday, January 16, 2004, 11:33:22 AM, you wrote:
KAM> What I have is an issue with posting forms with Dynamic ListBoxes.
KAM> What happens is when you fill the form out, and hit submit, it validates the
KAM> form .. if there is a required field not filled out, it comes back and gives
KAM> an error. All the textfields have all the information and the Static
KAM> ListBoxes have all the information they filled out... But if the user
KAM> selected a STATE (which is pulled dynamically) it will reset this box to the
KAM> default setting.
It will reset it when the page reloads with the error message, yes?
KAM> function build_states_tree(&$output, &$preselected) {
You already have the preselected variable in your function, so why not
just pass in whatever the user previously selected back to it again?
(i.e. over-ride whatever the initial preselected was?)
--
Best regards,
Richard mailto:rich@launchcode.co.uk