How can i remember the selected value from listmenu?
Posted: Mon Oct 12, 2009 12:10 am
I have a buttons named 'button1' and one Listmenu named listmenu1. All those button and Listmenu are in one form named form1
<?php
echo "<input type='submit' name='button1' id='button1' value='Go' />"; // button1
echo "<select name="listmenu1" id="listmenu1">
<option>a</option>
<option>b</option>
<option>c</option>
</select>"; .// listmenu1
if (isset($_POST['button1'])) // when user click on button1, button
{
$value=$_POST['listmenu1']; // get the selected value from listmenu1.assume that I selected b from listmenu1'.
}
?>
After click on the button1 I want to remaining the selected value of listmenu1.
If user select b from listmenu1 and click on button1,then listmenu1 should be selected as b.
How can i do this..?
thanking u all.....
<?php
echo "<input type='submit' name='button1' id='button1' value='Go' />"; // button1
echo "<select name="listmenu1" id="listmenu1">
<option>a</option>
<option>b</option>
<option>c</option>
</select>"; .// listmenu1
if (isset($_POST['button1'])) // when user click on button1, button
{
$value=$_POST['listmenu1']; // get the selected value from listmenu1.assume that I selected b from listmenu1'.
}
?>
After click on the button1 I want to remaining the selected value of listmenu1.
If user select b from listmenu1 and click on button1,then listmenu1 should be selected as b.
How can i do this..?
thanking u all.....