Okay, this is what I am trying to do:
<script language="JavaScript">
secondMenuArray = new Array()
function populateSecondMenu(mainItem)
{
// Create appropriate array full of Option
// objects. These are placed in the second menu
// later in this function
if (mainItem == "news")
{
secondMenuArray = new Array()
<?php
$location = localhost;
$database = ;
$passwd = ;
$connection = mysql_connect($location, $database, $passwd);
if ($connection == 1) {
$db = mysql_select_db("***", $connection);
}
else {
echo "Couldn't Connect to MySQL Server!";
exit;
}
$sql="Select * From noteCards";
$result = mysql_query($sql, $connection) or die ("<p>Error.");
while ($Myresult = mysql_fetch_array($result)) {
echo "populateArray(\"$Myresult[source]\",\"$Myresult[category]\")";
}
?> }
else if (mainItem == "research")
{
secondMenuArray = new Array()
populateArray("Downs Syndrome","research/downs.html")
populateArray("Cancer","research/cancer.html")
populateArray("Chromosome Capping","research/capping.html")
populateArray("AIDS","research/aids.html")
populateArray("Male Birth Control Pill","research/guy_pill.html")
}
...
...
...
}
function populateArray(displayText, nextPage)
{
nextIndex = secondMenuArray.length
secondMenuArray[nextIndex] = new Option(displayText,nextPage)
}
...
</script>
So, this results in two forms with nothing being generated in the second drop-down menu... If I take the php stuff out, it works just fine...
I am not sure what the idea behind the page reload is? Is there a web site I could reference?
Thanks!!!
Donald