chelnov63 Posted July 29, 2008 Share Posted July 29, 2008 Hi the following always seem to have NO selected even when the value $row_rsMusic['live'] is equivalent to Y ..is my syntax wrong? thanks in advance: <select name="select" id="select"> <option value="choose">Please choose</option> <option value="Y" selected='<?php if ($row_rsMusic['live'] == "Y") echo "selected"; ?>'>Yes</option> <option value="N" selected='<?php if ($row_rsMusic['live'] == "N") echo "selected"; ?>'>No</option> </select> Link to comment https://forums.phpfreaks.com/topic/117182-drop-down-list-issue/ Share on other sites More sharing options...
MatthewJ Posted July 29, 2008 Share Posted July 29, 2008 valid xhtml would be selected="selected" You might give that a try Link to comment https://forums.phpfreaks.com/topic/117182-drop-down-list-issue/#findComment-602732 Share on other sites More sharing options...
chelnov63 Posted July 29, 2008 Author Share Posted July 29, 2008 thanks but the above evaluates to that .. because the php echoes out "selected" Link to comment https://forums.phpfreaks.com/topic/117182-drop-down-list-issue/#findComment-602734 Share on other sites More sharing options...
MatthewJ Posted July 29, 2008 Share Posted July 29, 2008 heh... good point, it's still early here What does the source look like once you run it? Does it have selected='selected'? Link to comment https://forums.phpfreaks.com/topic/117182-drop-down-list-issue/#findComment-602738 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.