0

我正在为一个班级做一个项目,基本上是尝试进行一项调查,以根据人们想要的生活方式将他们与宿舍相匹配。我复制了表格的语法,其中一些正确弹出 - 问题出现在下拉菜单中,但随后出现的问题是“你打算多久去一次红狮”和“你打算怎么吃大部分你的饭菜”不显示,应该在下拉菜单中的选项显示为页面上的文本,而不是下拉菜单。有任何想法吗?继承人的代码:

<!DOCTYPE html>
<html> 
<head>
    <title> Find the right dorm for you </title>

    <h1>Find out what dorm fits your lifestyle!</h1>

</head>
<body>
    <p> Please fill out a few quesitons so we can help you figure out which dorm    is best for you. </p>

<form method="get" action="slutsky1-results.php">

    I enjoy (check all that apply):<br>
    <input type="checkbox" name="act1" value="8">Working Out<br>
    <input type="checkbox" name="act2" value="3">Bowling<br>
    <input type="checkbox" name="act3" value="3">Live Music<br>     
    <input type="checkbox" name="act4" value="5">Shopping<br>   
    <input type="checkbox" name="act5" value="7">Food<br>
    <input type="checkbox" name="act6" value="9">Bars <br>
    <input type="checkbox" name="act7" value="9">Frat Parties <br>
    <input type="checkbox" name="act8" value="8">Sports <br>
    <input type="checkbox" name="act9" value="3">Library <br>


    Is being close to the quad important to you?:
    <select name= "Quad">
    <option value="1">Not important</option>
    <option value="3">Kind of important</option>
    <option value="6">Very Important</option>
    <option value="3">Only thing that matters</option> <br>

    How often do you plan on going to Red Lion?:
    <select name= "Lion">
    <option value="1">Never</option>
    <option value="5">Sometimes</option>
    <option value="10">Over 3 times a week</option> <br>

    Would you rather go to the ARC or CRCE?:
    <select name= "Gym">
    <option value="10">Arc</option>
    <option value="1">CRCE</option>
    <br>

    How do you plan on eating most of your meals?:
    <select name= "Gym">
    <option value="5">Ordering delivery</option>
    <option value="8">Walking To Green St.</option>
    <option value="5">Making my own food</option>
    <br>

    Private or Public dorm?:
    <select name= "Gym">
    <option value="10">Private</option>
    <option value="5">Public</option>
    <br>



    <input type="submit" value="get my results!">

    </form>



    </body>

</html> 
4

2 回答 2

0

您没有关闭您的选择标签。所以浏览器试图猜测你想要完成什么。请记住,所有标签都应该关闭。

<select name= "Quad">
    <option value="1">Not important</option>
    <option value="3">Kind of important</option>
    <option value="6">Very Important</option>
    <option value="3">Only thing that matters</option>
</select>

如需帮助查找此类问题,请针对html 验证器运行您的页面。

于 2012-05-02T18:30:56.797 回答
0

您需要在选项列表之后关闭select标签(使用):</select>

<select name= "Gym">
    <option value="10">Arc</option>
    <option value="1">CRCE</option>
</select>

对每个列表都这样做。

于 2012-05-02T18:31:21.820 回答