Xtremer360 Posted August 8, 2011 Share Posted August 8, 2011 Anyone see any issue with this because its not showing the correct value for me. <?php $sortOrderArray = array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","0-9"); $sortOrder = ''; foreach ($sortOrderArray AS $letter) { $sortOrder .= "<option value=\"".$letter."\""; if ($letter == $row['sortOrder']) { } $sortOrder .= ">".$letter."</option>\r"; } ?> Link to comment https://forums.phpfreaks.com/topic/244243-not-showing-selected-value/ Share on other sites More sharing options...
Xtremer360 Posted August 8, 2011 Author Share Posted August 8, 2011 never mind I forgot $sortOrder .= " SELECTED"; inside the if statement. Link to comment https://forums.phpfreaks.com/topic/244243-not-showing-selected-value/#findComment-1254453 Share on other sites More sharing options...
AbraCadaver Posted August 8, 2011 Share Posted August 8, 2011 Missing something? if ($letter == $row['sortOrder']) { $sortOrder .= ' selected="selected"'; } Link to comment https://forums.phpfreaks.com/topic/244243-not-showing-selected-value/#findComment-1254455 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.