我目前已经建立了一个表单域(下拉菜单)和一个按钮。我遇到的唯一问题是,当我尝试在第一个下拉菜单下方创建另一个下拉菜单时,它会通过将信息扔出盒子而弄乱我原来的下拉菜单。有人可以看看我到底做错了什么,因为我不确定它为什么会发生。
<?php
$shows = array( "Sesame Street on Ice", "The Wiggles Live", "Dora Live" )
$prices = array( 29.99, 35.49, 49.95, 34.99, 9.99 );
?>
<html>
<head>
<title></title>
<style type="text/css">
body {
background: tan;
font-family: arial;
}
#contentwrap {
background-color: white;
border: 6px darkred solid;
padding: 110px;
width: 600px;
margin: 20px auto 20px auto;
border-radius: 25px;
-moz-border-radius: 25px;
}
#heading {
color: darkred;
font-size: 2.2em;
padding: 0px 0px 19px 0px;
margin: -70px -90px 5px -90px;
text-align: center;
}
#content {
height: 220px;
padding: 80px 0px 0px 0px;
background-repeat: no-repeat;
background-position: right;
}
#border {
color: lightblue;
border-bottom: 8px double;
padding: 0px 0px 65px 0px;
margin: -85px -80px 10px -80px;
}
#border2 {
color: darkred;
border-bottom: 8px double;
padding: 0px 0px 65px 0px;
margin: 180px -80px 0px -80px;
}
.formtext {
color: lightblue;
margin: -280px 0px 0px -50px;
}
.formtext2 {
color: lightblue;
margin: -10px 0px 0px -50px;
}
.formfield {
padding: 0px;
font-size: 1em;
width: 250px;
margin: 0px 0px 0px -50px;
color: black;
border: 2px darkred solid;
background-color: lightyellow;
border-radius: 4px;
}
</style>
</head>
<body>
<div id="contentwrap">
<div id="heading">Online Order Event Form</div>
<div id="border"></div>
<div id="content">
<div id="border2"></div>
<div class="formtext">Choose a show</div>
<select class="formfield" name="Show">
<div class="formtext">Select a number of tickets (max 4)</div>
<select class="formfield" name="Tickets">
<?php
for( $i = 0; $i < count( $shows ); $i++ ) {
echo "<option value=\"". $i ."\">". $shows[ $i ]
." $". $prices[ $i ] ."</option>\n";
}
?>
</select>
<div style="margin:160px 0px 80px -48px;">
<input type="submit" value="Order Tickets" />
</div>
</form>
</div> <!-- ends div#contentwrap -->
</body>
</html>