I am wondering if someone could point me in the right direction to
figure out how to create a dynamic form. I have been developing
programs in perl and oracle and have recently switched to php.
I need to create a form that has four of five seperate pick list on it.
Each item in each of the pick list depend on the users previous entry.
For instence if the user picks Ford then Taurus, Ranger, Focus,.etc show
up in the next pick list then the user picks Ranger and 2 wheel drive, 4
wheel drive, etc show in the next pick list box on so on.
I know how to this if the screen is refresed after each user entry. What
I would like to fugure out how to make the screen automatically update
each pick list and not refreshing the whole screen.
Any help or instruction would be great!
Thanks
Mark
Mark,
You can't do this in PHP. PHP is client-side only; to do it without
refreshing would require all the info be sent to the client, then
processed by a client-side language such as javascript.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstu...@attglobal.net
==================
I know you have to use server side javascript, but how?...
No, javascript it client side. So you need to use something like PHP
for the server side processing, and javascript for the client side.
Minor correction: PHP is SERVER-side ONLY
>
>
Yep, sorry :-)
I'd go with AJAX if I were you.
Let me know if you get this working. I've been wanting to add a similar
feature to my site. My alternative (and non-javascript version) will be
an ugly multi-page form.
Peace,
Jacob
on 02/18/2006 05:48 PM Mark Winter said the following:
Take a look at this forms generation and validation class. It comes with
linked select plug-in class that does exactly what you want.
It lets you define select inputs with multiple groups of options that
are switched dynamically when the value of another input changes.
There is a static version of the plug-in that lets you define the
alternative groups as an array, and there are several variants of the
plug-in that picks the groups options from a database using different
API: MySQL or database independent with Metabase or PEAR::MDB2 API.
http://www.phpclasses.org/formsgeneration
Here is an example page:
http://www.phpclasses.org/browse/view/html/file/9879/name/test_linked_select_page.html
--
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/