Page 1 of 1

storing combo box value using PHP

Posted: Sat Jun 14, 2008 12:08 am
by vb_123
hello friends,
i want to store combo box value using php and i have written a code like this
<tr>
<td><b>Task Status :</b></td>
<td>
<?php echo $status; ?>
<select name="status">
<option value="juststarted" <? if($status=="juststarted"){echo "SELECTED";}else{ echo "fail" ; } ?>>Just Started</option>
<option value="halfcompleted" <? if($status=="halfcompleted"){echo "SELECTED";} else{ echo "fail" ; } ?>>Half Completed</option>
<option value="almostcompleted" <? if($status=="almostcompleted"){echo "SELECTED";} else{ echo "fail" ; } ?>>Almost Completed</option>
<option value="completed" <? if($status=="completed"){echo "SELECTED";} else{ echo "fail" ; } ?>>Completed</option>
</select>
</td>
</tr>

but still it is not working properly and not showing the selected value.............pls solve the problem.........thanx in advance

Re: storing combo box value using PHP

Posted: Sat Jun 14, 2008 12:17 am
by vb_123
can anybody reply to this problem ??????????

hello friends,
i want to store combo box value using php and i have written a code like this
<tr>
<td><b>Task Status :</b></td>
<td>
<?php echo $status; ?>
<select name="status">
<option value="juststarted" <? if($status=="juststarted"){echo "SELECTED";}else{ echo "fail" ; } ?>>Just Started</option>
<option value="halfcompleted" <? if($status=="halfcompleted"){echo "SELECTED";} else{ echo "fail" ; } ?>>Half Completed</option>
<option value="almostcompleted" <? if($status=="almostcompleted"){echo "SELECTED";} else{ echo "fail" ; } ?>>Almost Completed</option>
<option value="completed" <? if($status=="completed"){echo "SELECTED";} else{ echo "fail" ; } ?>>Completed</option>
</select>
</td>
</tr>

but still it is not working properly and not showing the selected value.............pls solve the problem.........thanx in advance[/quote]

Re: storing combo box value using PHP

Posted: Sat Jun 14, 2008 12:29 am
by vb_123
wats the problem with the above code why it is not showing the selected value in combo box

Re: storing combo box value using PHP

Posted: Sat Jun 14, 2008 1:02 am
by WebbieDave
You already have an active thread on this exact subject:

viewtopic.php?f=1&t=84100&start=0&st=0&sk=t&sd=a

Re: storing combo box value using PHP

Posted: Sat Jun 14, 2008 2:07 pm
by califdon
This topic is locked. Duplicate (several) posts, probably wrong forum, too.