Javascript js中的get请求未在url中追加表单数据
它是一个用于表单页面的快速路由器模块,用于接收用于添加书籍详细信息的数据。但在提交时,url中不包含任何表单数据。在“?”后面是空白的 网址显示http://localhost:5000/admin/addBook/add?"Javascript js中的get请求未在url中追加表单数据,javascript,html,node.js,express,Javascript,Html,Node.js,Express,它是一个用于表单页面的快速路由器模块,用于接收用于添加书籍详细信息的数据。但在提交时,url中不包含任何表单数据。在“?”后面是空白的 网址显示http://localhost:5000/admin/addBook/add?" <form class="container col-md-5 signupform bg-white my-4 py-3 formShadow" method="GET" action=&qu
<form class="container col-md-5 signupform bg-white my-4 py-3 formShadow" method="GET"
action="/admin/addBook/add" , onsubmit="return validate()">
<label class="form-label ">ENTER BOOK TITLE:</label>
<input class="form-control " type="text" placeholder="Book Title" id="title">
<br>
<label class="form-label">ENTER BOOK AUTHOR:</label>
<input class="form-control " type="text" placeholder="Book Author" id="author">
<br>
<label class="form-label">ENTER BOOK GENRE:</label>
<input class="form-control " type="text" placeholder="Book Author" id="genre">
<br>
<label class="form-label ">UPLOAD IMAGE:</label>
<input class="form-control " type="file" id="image">
<br>
<div class="text-center">
<button type="submit" class="btn loginbutton" id="add">ADD</button>
</div>
</form>
输入书名:
输入图书作者:
输入图书类型:
上载图像:
添加
没有一个表单元素具有名称
属性,浏览器将该属性用作键/值对中的键。因为没有密钥,所以没有要发送的数据
添加name
属性:
<input class="form-control " type="text" placeholder="Book Title" id="title" name="title">
<!-- etc. -->