2017-08-14 21 views
-9
<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

您還沒有關閉,選擇欄定義選項之後即 –

回答

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,請指定當前輸出的內容以及您希望的輸出內容。如果你提供了一些你已經完成的研究來解決這個問題,它也會有所幫助。

希望這可以幫助你!