RE:AGAIN [PHP] Forms, ListBoxes, Validating Errors.
| From: | Kacey A. Murphy | Date: | Fri, 16 Jan 2004 11:51:05 +0000 |
| Subject: | RE:AGAIN [PHP] Forms, ListBoxes, Validating Errors. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-174777@lists.php.net to get a copy of this message | ||
-----Original Message-----
From: Richard Davey [mailto:rich@launchcode.co.uk]
Sent: Friday, January 16, 2004 6:43 AM
To: Kacey A. Murphy
Cc: php-general@lists.php.net
Subject: Re: [PHP] Forms, ListBoxes, Validating Errors.
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
KAM> validates the form .. if there is a required field not filled out, it
KAM> comes back and gives an error. All the textfields have all the
KAM> information and the Static ListBoxes have all the information they
KAM> filled out... But if the user
KAM> selected a STATE (which is pulled dynamically) it will reset this box
KAM> to the default setting.
RD > It will reset it when the page reloads with the error message, yes?
KAM> function build_states_tree(&$output, &$preselected) {
RD > You already have the preselected variable in your function, so why not
RD > just pass in whatever the user previously selected back to it again?
RD > (i.e. over-ride whatever the initial preselected was?)
----------------
I think that makes sense I will tweak the code for a little bit to see what
comes of it.
Just wasn't quite sure how to make the code correctly and efficiently.
Thanks so much for the quick respons.