Hello,

on 05/30/2006 11:03 PM Beauford said the following:
> I have a form with about 20 fields in it and have two drop down menus in
> which the second one changes depending on the previous one. This is done
> with a javascript which reloads the page.
> 
> The problem with this is that everything the user has put in so far gets
> erased when the page reloads. I am using PHP sessions, but at this point
> these fields are not saved yet.
> 
> Is there a way to do this using sessions, or some other PHP function. All
> the javascript I've looked at reloads the page.
> 
> This also screws up my validation routines.

You may want to try this forms generation and validation class. It
provides means to do exactly what you want.

It comes with several plug-ins that simplify the implementation of
controls like you want.

There is one plug-in that can link 2 or more select inputs, on which one
switches its group of options when another changes the currently
selected value.

The new group of options can be loaded from a static array or
dynamically connecting to the server via AJAX and executing some task
that gets the new set options depending on the new linked select value.

It comes also with several variants of the plugin that query databases
to retrieve the new sets of options.

Here is a screenshot of a form using the static array version:

http://www.phpclasses.org/browse/view/html/file/9879/name/test_linked_select_page.html


There is also a more generic plug-in form submitting the form using
AJAX. This means that you can submit the form without reloading the
page. In response you can tell the class to make the current browser
page be updated arbitrarily.

There is now even a plug-in to integrate with Google Maps, but that is
anothe story:

The class and all plug-ins are available here. See the dependent classes
too for more third party plug-ins:

http://www.phpclasses.org/formsgeneration


-- 

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to