Checkbox and list problem
Posted: Sun Feb 07, 2010 8:14 pm
Hi there
I want my form to keep values entered by user after submit form. It works for input text fields but for lists and checkbox it refreshes the selection. I have no idea how lists can rember their selected option.
And this is what i'm doing for Checkbox
if (isset($_POST['cb1']))
{$_SESSION['cb1']= 'Yes';}
<input type="checkbox" name="cb1" value= "<?php echo $_SESSION['cb1']; ?>" onClick="validate();" >
Any help ??
I want my form to keep values entered by user after submit form. It works for input text fields but for lists and checkbox it refreshes the selection. I have no idea how lists can rember their selected option.
And this is what i'm doing for Checkbox
if (isset($_POST['cb1']))
{$_SESSION['cb1']= 'Yes';}
<input type="checkbox" name="cb1" value= "<?php echo $_SESSION['cb1']; ?>" onClick="validate();" >
Any help ??