$username Posted November 29, 2007 Share Posted November 29, 2007 Hello PHPers I am working on making a drop down box with in my PHP echo. Can some let me know if this is right? echo ("<td><select name=\'WebCaseTypeSet'>".$no_opt. "</option>" .$yes_opt. "</option></select><big></big></td>"); Quote Link to comment Share on other sites More sharing options...
revraz Posted November 29, 2007 Share Posted November 29, 2007 Your first OPTION shouldn't have a backslash in it. Quote Link to comment Share on other sites More sharing options...
$username Posted November 29, 2007 Author Share Posted November 29, 2007 Here is my revised code echo ("<td><select name=\"WebCaseTypeSet\">".$no_opt. "</option>" .$yes_opt. "</option></select><big></big></td>"); I also have this that is doing to MYSQL work $sql202 = "SELECT WebID, WebCasesType, WebCaseTypeSet FROM webdisplay"; $query202 = mysql_query($sql202); while($row202 = mysql_fetch_array($query202)) { $no_opt = '<option value="No" '; $yes_opt = '<option value="Yes" '; if ($row202["WebCaseTypeSet"] == "No") $no_opt .= 'selected=selected'; else $yes_opt .= 'selected=selected'; $no_opt .= '>'; $yes_opt .= '>'; Quote Link to comment Share on other sites More sharing options...
emehrkay Posted November 29, 2007 Share Posted November 29, 2007 you should try to indent your html so that you can easily see your mistakes echo "<td> <select name=\"WebCaseTypeSet\"> ".$no_opt. "</option> " .$yes_opt. "</option> </select> <big></big> </td>"; That clearly isnt correct html formatting. You do not have opening tags for your options. and is big a tag? Quote Link to comment Share on other sites More sharing options...
$username Posted November 29, 2007 Author Share Posted November 29, 2007 In the code I have the $no_opt = '<option value="no" '; $no_opt = '<option value="No" '; $yes_opt = '<option value="Yes" '; Quote Link to comment Share on other sites More sharing options...
$username Posted November 29, 2007 Author Share Posted November 29, 2007 I got it it was my mistake echo "<td> <select name=\"WebCaseTypeSet\"> ".$no_opt. "[b]No[/b]</option> " .$yes_opt. "[b]Yes[/b]</option> </select> <big></big> </td>"; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.