Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select tag in php help 1

Status
Not open for further replies.

jgurgen

Programmer
Mar 9, 2006
192
0
0
US
im trying to create a select to allow users to select from multiple options. The problem is for some reason i cannpt get it to work right with php. when i put <select> in php tags it doesnt redirect the page but when i remove the <select> tags from the php it does work. Please help

i commented out the php tags that i was using but wasnt working

WORKING CODE
Code:
<select name="SeasonSelect" onchange="MM_jumpMenu('parent',this,0)">
<?PHP 
							//echo '<select name="SeasonSelect" onchange="MM_jumpMenu(''parent'',this,0)">';
							  while($season_row = mysql_fetch_array($sql2))
{
							  	$SeasonID = $season_row['id'];
								$Season = $season_row['season'];
							  	echo '<option value="Edit_Season.php?SeasonID='.$SeasonID.'">'.$Season.'</option>';
}
//echo '</select>';
?>
							</select>
 
The SELECT statement you have commented out should read \'parent\' instead of ''parent''.

Or you could inverse it.

echo "<select name='SeasonSelect' onchange='MM_jumpMenu(\"parent\", this, 0)'>";
 
thanks, just learning php and read about the escape characters.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top