Forum Moderators: open

Message Too Old, No Replies

Need help with drop down menu

drop down menu

         

nOObie

8:10 pm on Jul 16, 2004 (gmt 0)

10+ Year Member



I've had trouble communicating with a database so I'm running a search HTML style using several modes's. I have a menu created with which users can select a country to search by. When the U.S. is selected another menu appears with states. I'd like the menu options (all countries and US states - note that I do not want the U.S. option to link to a mode because selecting US will open the states menu which will link to modes for each state) to link to modes.
I apologize if that was confusing. Please ask questions if any part was unclear. Thanks for your time and help.

Here is the Script:
------------------------------------------------------

<?php
include("header.php");
?>
<tr>
<td bgcolor="#000000" width=236 align="right" style="border-right: 1px solid #FFFFFF;" nowrap><font

color="#FFFFFF">STORE SEARCH</font>&nbsp;</td>
<td bgcolor="#000000" width=514 nowrap>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#838332" vAlign="top" align="right" style="border-right: 1px solid #FFFFFF; padding: 5px;">

<script language="JavaScript">

function dropdown()
{
if ( document.search.search_by.selectedIndex == 8 )
{
document.all.dropdown.innerHTML = '<b>State:</b> <select name="search_state"> <option>AL</option> <option>AK</option> <option>AZ</option> <option>AR</option> <option>CA</option> <option>CO</option> <option>CT</option> <option>DE</option> <option>FL</option> <option>GA</option> <option>HI</option> <option>ID</option> <option>IL</option> <option>IN</option> <option>IA</option> <option>KS</option> <option>KY</option> <option>LA</option> <option>ME</option> <option>MD</option> <option>MA</option> <option>MI</option> <option>MN</option> <option>MS</option> <option>MO</option> <option>MT</option> <option>NE</option> <option>NV</option> <option>NH</option> <option>NJ</option> <option>NM</option> <option>NY</option> <option>NC</option> <option>ND</option> <option>OH</option> <option>OK</option> <option>OR</option> <option>PA</option> <option>RI</option> <option>SC</option> <option>SD</option> <option>TN</option> <option>TX</option> <option>UT</option> <option>VT</option> <option>VA</option> <option>WA</option> <option>WV</option> <option>WI</option> <option>WY</option> </select> <br>';
}
else if ( document.search.search_by.selectedIndex == 99 )
{
document.all.dropdown.innerHTML = '<b>Country:</b> <select

name="search_country"><option>Australia</option> <option>Belgium</option> <option>Canada</option> <option>France</option> <option>Netherlands</option> <option>South Africa</option><option>United Kingdom</option><option>United States</option></select><br>';
}
else
{
document.all.dropdown.innerHTML = '';
}
}

</script>

<form name="search" method="post">
<!-- <b>For:</b> <input type="text" name="keyword" style="font-size: 9pt;"><br> -->
<select name="search_by" onChange="javascript:dropdown()" style="font-size: 9pt;">
<option>Select a country...</option>
<option>Australia</option>
<option>Belgium</option>
<option>Canada</option>
<option>France</option>
<option>Netherlands</option>
<option>South Africa</option>
<option>United Kingdom</option>
<option>United States</option>
</select><br><span id="dropdown"></span>
</form>

</td>
<td bgcolor="#CC6600" vAlign="top" style="padding-left: 5px;">
<img src="images/clear.gif" height=15><br>
<?php
{
echo 'Until the Store Search is running please email our office, office@********.com with all store related

questions.<br>Thank You for your patience.';
}

?>
<img src="images/clear.gif" height=15><br><img src="images/clear.gif" height=15><br></td>
</tr>
<?php
include("footer.php");
?>
------------------------------------------------------
Thanks Again

nOObie

7:27 pm on Jul 18, 2004 (gmt 0)

10+ Year Member



*bump* Please help. thanks