PDA

View Full Version : form question .. please help !


HormonX
08-02-2002, 12:42 AM
Am having a bit of a problem, here it is ..

i have a form where users fill in the information ... one of them is a pull-down menu where they can select category .. this is where my problem starts, i would like to have another pull-down menu appear as soon as they make a selection from the first pull-down menu ( like a sub_category)

am having a peoblem with combining javascript and php together. The values for the second pull-down menu should be taken from the database .

anyone can offer some help ...

thanx in advance ...

i hope i didn't confuse anyone

firepages
08-02-2002, 02:10 AM
If you want to do this without a page refresh then you are going to have to load all the possible datasets for the second menu into a javascript array and then use javascript to display the pertinent results, what you can not do (without a refresh) is call the database for the second set of results at the client side.

You could BTW utilise a hidden frame - set an onclick action to your 1st dropdown to a form in the hidden frame which grabs the data from the DB and then updates the second dropdown in the main frame but thats a pain in the bum to get working smoothly :)

HormonX
08-02-2002, 02:23 AM
well .. see ... i have got the javascript for the double pull-down menu working without a problem, but this is static. I would like to do it dynamicaly. This is where my problem starts. Am not sure how to get everything together ... meaning php and javascript so they work. For me is not a problem if the page refreshes or not ... eather way as long as it works :)

Am fairly new to php and mysql that's why this is such a chalenge for me .... but i guess i have to start somewhere :)

thanx again

HormonX
08-04-2002, 09:37 PM
how would i go about doing this menu with page refresh ?

HormonX