Sticky radios without form submission?
Posted: Sat Mar 25, 2006 11:28 am
Hi guys,
Am developing a CMS, and the current page I am working on has a number of options for the user to select using radios. They have the option to include some external links, the number of which can be selected from a jump menu. The code below work perfectly, but when the page is redisplayed with input fields for the external links, the radios are reset.
Is there a way to make the radios sticky without submitting the form? If not (and I suspect this will be the case), is there a better method to use than a jump menu to reload the page with the input fields?
Thanks in advance,
Matt.
Am developing a CMS, and the current page I am working on has a number of options for the user to select using radios. They have the option to include some external links, the number of which can be selected from a jump menu. The code below work perfectly, but when the page is redisplayed with input fields for the external links, the radios are reset.
Code: Select all
<form name="form1" method="post" action="">
<table width="445" border="0" cellspacing="3" cellpadding="0">
<tr>
<td width="315"><strong>Do you require "back" and "next" buttons? </strong></td>
<td width="66"><input name="bn_buttons" type="radio" value="1" checked>
Yes </td>
<td width="64"><input name="bn_buttons" type="radio" value="0">
No</td>
</tr>
<tr bgcolor="#CCCCCC">
<td><strong>Would you like a "quick menu"? </strong></td>
<td><input name="q_menu" type="radio" value="1">
Yes</td>
<td><input name="q_menu" type="radio" value="radiobutton">
No</td>
</tr>
<tr>
<td><strong>How many external links would you like?</strong></td>
<td colspan="2"><select name="el_menu" class="el_menu" onChange="MM_jumpMenu('parent',this,1)">
<option selected><? if(isset($_GET['el'])){ echo $_GET['el']; }else{ echo "None"; } ?></option>
<option value="<? echo $_SERVER['PHP_SELF'] . "?el=1"; ?>">1</option>
<option value="<? echo $_SERVER['PHP_SELF'] . "?el=2"; ?>">2</option>
<option value="<? echo $_SERVER['PHP_SELF'] . "?el=3"; ?>">3</option>
<option value="<? echo $_SERVER['PHP_SELF'] . "?el=4"; ?>">4</option>
</select> </td>
</tr>
<tr bgcolor="#CCCCCC">
<td><strong>Will the main menu display on every page? </strong></td>
<td><input name="m_menu" type="radio" value="1">
Yes</td>
<td><input name="m_menu" type="radio" value="0" checked>
No</td>
</tr>
<tr bgcolor="#FFFFFF">
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr bgcolor="#CCCCCC">
<td>
<? if(isset($_GET['el'])){
if($_GET['el']){
$s = s;
}
echo "<p><b>Please enter the URL$s and the name$s of the link$s below</b></p>";
$el_num = $_GET['el'];
$i = 1;
while($i <= $el_num){
echo "External link # $i <input type=\"text\" name=\"el_name_$i\" value=\"Label\"> <input type\"text\" name=\"el_url_$i\" value=\"URL\"><br><br>";
$i++;
}
}
?>
</td>
</tr>
</table>
</form>Thanks in advance,
Matt.