Connecting Tech Pros Worldwide Forums | Help | Site Map

Dynamic Pick list question.

Mark Winter
Guest
 
Posts: n/a
#1: Feb 18 '06
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

Jerry Stuckle
Guest
 
Posts: n/a
#2: Feb 18 '06

re: Dynamic Pick list question.


Mark Winter wrote:[color=blue]
> 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[/color]

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.
jstucklex@attglobal.net
==================
Mark Winter
Guest
 
Posts: n/a
#3: Feb 18 '06

re: Dynamic Pick list question.


Right,

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


[color=blue][color=green]
>>
>> Thanks
>>
>> Mark[/color]
>
>
> 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.
>
>[/color]
Jerry Stuckle
Guest
 
Posts: n/a
#4: Feb 19 '06

re: Dynamic Pick list question.


Mark Winter wrote:[color=blue]
> Right,
>
> I know you have to use server side javascript, but how?...
>
>
>[color=green][color=darkred]
>>>
>>> Thanks
>>>
>>> Mark[/color]
>>
>>
>>
>> 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.
>>
>>[/color][/color]

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.
jstucklex@attglobal.net
==================
noone
Guest
 
Posts: n/a
#5: Feb 19 '06

re: Dynamic Pick list question.


Jerry Stuckle wrote:[color=blue]
> Mark Winter wrote:
>[color=green]
>> 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[/color]
>
>
> 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.[/color]

Minor correction: PHP is SERVER-side ONLY
[color=blue]
>
>[/color]
Jerry Stuckle
Guest
 
Posts: n/a
#6: Feb 19 '06

re: Dynamic Pick list question.


noone wrote:[color=blue]
> Jerry Stuckle wrote:
>[color=green]
>> Mark Winter wrote:
>>[color=darkred]
>>> 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[/color]
>>
>>
>>
>> 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.[/color]
>
>
> Minor correction: PHP is SERVER-side ONLY
>[color=green]
>>
>>[/color][/color]

Yep, sorry :-)

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
samudasu
Guest
 
Posts: n/a
#7: Feb 19 '06

re: Dynamic Pick list question.


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

dbee
Guest
 
Posts: n/a
#8: Feb 19 '06

re: Dynamic Pick list question.


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.

Mark Winter
Guest
 
Posts: n/a
#9: Feb 19 '06

re: Dynamic Pick list question.


Thanks, it looks like what I want. I will try to implement it.
I might even learn something...


dbee wrote:[color=blue]
> 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.
>[/color]
Jacob Lyles
Guest
 
Posts: n/a
#10: Feb 19 '06

re: Dynamic Pick list question.


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

Manuel Lemos
Guest
 
Posts: n/a
#11: Feb 20 '06

re: Dynamic Pick list question.


Hello,

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

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/
Closed Thread