using javascript onchange with php

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
ozmodiar
Forum Commoner
Posts: 35
Joined: Sat Jun 01, 2002 6:29 am
Location: Dublin, Ireland

using javascript onchange with php

Post by ozmodiar »

Does anyone know if it is possible to use the javascript onChange function in conjunction with php?

I am trying to create a form with a drop down menu called group type. When this is changed, i want to select all the groups of that type from a mysql database and create another drop down menu based on the results of the mysql query.

I would ideally like to do this without submitting the form.
All I could find is how to pass PHP variables to javascript but I want it the other way

Is this possible and if so can you help me?

Thank you
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

MattF
Forum Contributor
Posts: 225
Joined: Sun May 19, 2002 9:58 am
Location: Sussex, UK

Post by MattF »

Basically try some PHP code that echo's out an array (or three) out in JavaScript then use onChange to select one of the arrays of values.
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post by BDKR »

ozmodiar,

Check the recent 'php and Dom' thread. I posted a Javascript function that can get you to the church on time.

Later on,
BDKR
Post Reply