HTML代码 - 输出不是我想要的

HTML代码 - 输出不是我想要的

问题描述:

<body> 
    <form action= "http://norton.open.ac.uk/reflect.php" method= "post" name= "form1"> 
     <h1> Book Details: </h1> 
    <select name= "dropdown"> 
     <option value= "Books" selected>Books</option> 
     <option value= "Magazines">Magazines</option> 
     <option value= "Journals">Journals</option> 
     <option value= "Newspapers">Newspapers</option> 

    <p> 
    <b>Book name:</b> <input type = "text" name = "book_name" /> </p> 
    <p> 
    <b>Author:</b> <input type = "text" name = "author" /> </p> 
    <p> 
    <b>Publication Year:</b> <input type = "date" name = "publication_year" /> </p> 
    <p> 
    <b>ISBN Number:</b> <input type = "number" name = "isbn_number" /> </p> 

    <input type= "submit" name= "submit" value= "Submit" /> 
    </form> 

我很确定代码有什么问题,我只是无法确定它到底是什么。输出不是我想要的。HTML代码 - 输出不是我想要的

+3

您的预期输出是什么? –

+3

*“输出不是我想要的。”* - 你想要什么输出**做**? –

+0

您还没有关闭,选择栏定义选项之后即 –

因此,有几件事情,你需要做的就是这个工作......

<input type="submit" /> 

如果你需要设置某种在JS提交的,你可以使用一个ID。

不是100%肯定你有什么打算在这里,但你的方式都看起来像这样:

<form action="http://norton.open.ac.uk/reflect.php" id="form1"> 
    <div> 
     <label for="book">Book Name:</label> 
     <input type="text"> 
    </div> 
    <div> 
     <label for="author">Author:</label> 
     <input type="text"> 
    </div> 
    <div> 
     <label for="publication">Publication Year:</label> 
     <input type="text"> 
    </div> 
    <div> 
     <label for="isbn">ISBN Number:</label> 
     <input type="number"> 
    </div> 
    <div> 
     <input type="submit"> 
    </div> 
</form> 

确保HTML元素标签内你的价值观是:type=""对什么是你目前的状态type= ""。无需在两者之间的空间。

此外,为了将来的参考,请说出你想要完成的事情。如果您要提交这样的表格,并且您使用的是JS,请指定当前输出的内容以及您希望的输出内容。如果你提供了一些你已经完成的研究来解决这个问题,它也会有所帮助。

希望这可以帮助你!