Hi Everyone!
I'm trying to figure out how to use radio buttons to change the contents of a drop down menu. Here's the code I'm working with:
<script language="javascript" src="../chainedselect.js">
<script language="javascript" src="../chained_search_menu.js">
/********************************************
Chained Select Menu- By Xin Yang (http://www.yxscripts.com/) & Dynamic Drive (http://dynamicdrive.com)
Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
This notice must stay intact for legal use!
*********************************************/
</script>
<script language="javascript" src="../search_menu_config.js"></script>
<form style="margin: 10px 0px 0px 0px;"><h2 class="style5"><input name="locale" type="radio" value="1" style="width:15px;"
checked>
USA <input name="locale" type="radio" value="2" style="width:15px;">
CAN</h2></form>
<form name="netsearchform" method="post" style="width:130px; margin: 10px 0px 0px 0px" action=
<?php if(!array_key_exists("user_id", $_SESSION)) { echo "/networker/search_disabled.php";
} else { echo "/networker/net_search.php"; } ?> target="centerbox">
<h2 class="style5">Name</h2>
<input name="SearchName" type="text" id="SearchName" style="width:130px; margin: 0px 0px 0px 0px">
<select name="StateSearch" style="width:136px; margin: 10px 0px 0px 0px"></select>
<select name="CitySearch" style="width:136px; margin: 10px 0px 0px 0px"></select></select>
<input type="submit" name="Search" value="Search" style="margin: 10px 0px 0px 70px"></form>
I'd like to use Php to determine which radio button was pushed (1 or 2) and then based on that it would change the src= URL in the javascript form. SO this was what I was thinking:
The user clicks on the radio button (either USA or CAN).
Then Php stores the result from the radio button (1 or 2) as a variable.
In the javascript form, a php if statement determines if the variable is 1 or 2 and based on that echos the url into the 'src=' section of the form.
Does that sound about right? I'm just not sure how to code all that!?!?! ???
THANKS A LOT FOR YOUR HELP! 😉