为什么我的表单会跳过其他所有项目

时间:2012-05-02 18:28:10

标签: forms

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

<!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> 

2 个答案:

答案 0 :(得分: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 validator运行您的网页。

答案 1 :(得分:0)

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

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

对每个列表都这样做。