By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,536 Members | 1,504 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,536 IT Pros & Developers. It's quick & easy.

Dynamic Pick list question.

P: n/a
Hello,

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
Feb 18 '06 #1
Share this Question
Share on Google+
10 Replies


P: n/a
Mark Winter wrote:
Hello,

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.
js*******@attglobal.net
==================
Feb 18 '06 #2

P: n/a
Right,

I know you have to use server side javascript, but how?...

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.

Feb 18 '06 #3

P: n/a
Mark Winter wrote:
Right,

I know you have to use server side javascript, but how?...

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.


No, javascript it client side. So you need to use something like PHP
for the server side processing, and javascript for the client side.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Feb 19 '06 #4

P: n/a
Jerry Stuckle wrote:
Mark Winter wrote:
Hello,

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.


Minor correction: PHP is SERVER-side ONLY

Feb 19 '06 #5

P: n/a
noone wrote:
Jerry Stuckle wrote:
Mark Winter wrote:
Hello,

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.

Minor correction: PHP is SERVER-side ONLY


Yep, sorry :-)

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Feb 19 '06 #6

P: n/a
You can do this with AJAX.
http://developer.mozilla.org/en/docs...etting_Started

Feb 19 '06 #7

P: n/a
You could try it with javascript.
But you'd be talking about a quite large and complex javascript file.

I'd go with AJAX if I were you.

Feb 19 '06 #8

P: n/a
Thanks, it looks like what I want. I will try to implement it.
I might even learn something...
dbee wrote:
You could try it with javascript.
But you'd be talking about a quite large and complex javascript file.

I'd go with AJAX if I were you.

Feb 19 '06 #9

P: n/a
Hey Mark,

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

Feb 19 '06 #10

P: n/a
Hello,

on 02/18/2006 05:48 PM Mark Winter said the following:
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.


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/vie...lect_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/
Feb 20 '06 #11

This discussion thread is closed

Replies have been disabled for this discussion.