I can give you the JS code, but I don't know how to make it use the db, if
there is a way, or how to make it call PHP, if there's a way to do that.
Sorry.
Here's what we do when someone switches the Incidence/Mortality box, which
has an
onChange='changeAreas();'
function changeAreas()
{
//alert("change areas");
//var AreaObject = document.UserForm.GeoAreaBox;
var DataObject = document.UserForm.IncdMortBox;
if (DataObject.options[DataObject.selectedIndex].value == "1")
//1=mort
SwitchToMortality();
else if (DataObject.options[DataObject.selectedIndex].value == "0")
//0=incd
SwitchToIncidence();
}
function SwitchToIncidence() //SwitchToMortality() is the same but has
different choices
{
//alert("switch to incidence");
var AreaObject = document.UserForm.GeoAreaBox;
AreaObject.length = 0;
AreaObject.options[0] = new Option("12 SEER Registries");
AreaObject.options[0].value = "52";
AreaObject.options[1] = new Option(" 11 SEER Registries");
AreaObject.options[1].value = "51";
///....
AreaObject.selectedIndex = 0;
}
-----Original Message-----
From: Phillip S. Baker [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 25, 2002 4:02 PM
To: Leotta, Natalie (NCI/IMS); [EMAIL PROTECTED]
Subject: RE: [PHP] Menu Selections Dynamic from a Database
At 12:57 PM 6/25/2002 Tuesday, Leotta, Natalie (NCI/IMS) wrote:
>Unless you want to submit or use frames, you need to use JavaScript to
>populate the second dropdown based upon the value of the first one.
>PHP doesn't let you do this without the submit or frames because it's
>server-side, whereas JS is client-side.
>
>If you need any code let me know.
>
>Good luck!
>
>-Natalie
Yes I knew it was Javascript code, but I also thought PHP was needed to get
the values from the DB.
Either case I do need help with what the code might look like.
Phillip
>-----Original Message-----
>From: Phillip S. Baker [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, June 25, 2002 3:55 PM
>To: [EMAIL PROTECTED]
>Subject: [PHP] Menu Selections Dynamic from a Database
>
>
>Greetings All,
>
>Here is the problem I am trying to solve, I know it can be done but I
>am not clear on how to do it.
>
>I am generating an appointment application.
>And I want to dynamically populate pulldown menus from values in a DB.
>
>So if a person picks a day for an appointment in a pulldown menu, then
>next pulldown menu on the page is dynamically populated with the
>available times for that specific day. The values for both menus will
>be pulled from information in a MySQL db.
>
>Can anyone help me out with this?
>
>Phillip
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php