我正在尝试通过注册表单创建一个pug文件,并且下拉菜单无法正常工作。如何将下拉菜单包含在正文解析器中?我认为它将与json.stringify一起使用。
signup.html
<div class="email">
<span class="Req">*</span> <label for="Email Address"><b>Email
Address:</b></label> <input type="text" name="Email Address:" id=
"email">
</div>
<p>Have you ever paid for ideas?</p><input type="radio" name="paid"
value="Yes" checked> Yes<br>
<input type="radio" name="paid" value="No">No<br>
<div class=menu>
<p>Where do you usually shop for ideas?</p>
<div class="custom-select">
<select>
<option value="0">
My Brain
</option>
<option value="1">
Other People
</option>
<option value="2">
The Internet
</option>
</select>
</div>
</div>
<p>Have you ever purchased ideas?</p><input type="radio" name=
"paid2" value="Yes" checked> Yes<br>
<input type="radio" name="paid2" value="No">No<br>
<p>How does using other peoples ideas compare to using/creating your own?<br>
server.js
app.get('/', function(req, res, next){
res.sendFile(express.static(__dirname+ "/bin/www/index.html"));
});
app.get('/SignUp', function(req, res, next){
res.sendFile(express.static(__dirname+'/bin/www/Signup.html'));
});
app.get('/FAQ', function(req, res, next){
res.sendFile(express.static(__dirname+'/bin/www/FAQ.html'));
});
// app.post method here for signUp
app.post('/Signup', function(req, res){
res.end(JSON.stringify(req.body));
});"
答案 0 :(得分:0)
您需要为Select元素添加name
属性
<select name="some-name">