faqts : Computers : Programming : Languages : PHP : Common Problems : Forms and User Input

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

3 of 8 people (38%) answered Yes
Recently 2 of 7 people (29%) answered Yes

Entry

How can I have in a form two "select" type, but the contains for the 2nd field depend on what user have choosen in the first one (datas from mysqL)

Dec 26th, 2005 08:22
Praveen Kumar Kukkapalli, Jacques jocelyn,


Use Javascript to submit the form based on onSelect for the first select
box then select teh values for teh second selectbox based on the value
selected in the first select box and show. This way you can do with
lesser load on server.
The second way is to select values for all and stoe in an array based on
javascript onselect show the respective array. here you need to
preselect all the values and show.