Page 1 of 1

using javascript onchange with php

Posted: Tue Aug 13, 2002 6:25 am
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

Posted: Tue Aug 13, 2002 6:39 am
by twigletmac

Posted: Tue Aug 13, 2002 7:24 am
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.

Posted: Tue Aug 13, 2002 10:41 am
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