storing combo box value using PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
vb_123
Forum Newbie
Posts: 19
Joined: Wed May 21, 2008 2:16 am

storing combo box value using PHP

Post 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
vb_123
Forum Newbie
Posts: 19
Joined: Wed May 21, 2008 2:16 am

Re: storing combo box value using PHP

Post 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]
vb_123
Forum Newbie
Posts: 19
Joined: Wed May 21, 2008 2:16 am

Re: storing combo box value using PHP

Post by vb_123 »

wats the problem with the above code why it is not showing the selected value in combo box
WebbieDave
Forum Contributor
Posts: 213
Joined: Sun Jul 15, 2007 7:07 am

Re: storing combo box value using PHP

Post 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
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: storing combo box value using PHP

Post by califdon »

This topic is locked. Duplicate (several) posts, probably wrong forum, too.
Post Reply