drop down problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
leewad
Forum Commoner
Posts: 91
Joined: Tue May 11, 2004 8:32 am

drop down problem

Post by leewad »

Hi

I have a combo drop down box which changes the content of one drop down depending on the select of the other, to change this the code is

Code: Select all

<select name="area" size="1" onChange="redirect(this.options.selectedIndex)">
is there a way i can do it with php without having to select it manually? like once the page has loaded etc?
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

I don't think so. PHP is a server-side language. What you want is done on the client-side, so you are going to be wanting JavaScript type technology.
jonra
Forum Newbie
Posts: 22
Joined: Thu May 25, 2006 9:35 am
Location: Iowa
Contact:

Post by jonra »

Everah is right... once the page is loaded, PHP is done being interpreted and you'd have to reload the page to do this. I usually use a combo of JavaScript and PHP together to get functionality out of select boxes.
Post Reply