如标题,今天出的问题,input标明了 id = 'name'
但是req.body.name
就是获取不到。请帮忙
5 回复
嗯,打印了
body = {}
以下为标签:
<form class="form-signin" action="/login" method="POST">
<fieldset>
<h2 class="form-signin-heading">请登陆</h2>
<% if(locals.error){ %>
<div class="alert alert-error">
<a class="close" data-dismiss="alert" href="#">×</a>
<strong><%= error %></strong>
</div>
<% } %>
<input id='name' type="text" class="input-block-level" placeholder="用户名">
<input id='password' type="password" class="input-block-level" placeholder="密码">
<label class="checkbox">
<input id='isRemember' type="checkbox" value="remember-me"> 记住我
</label>
<button class="btn btn-large btn-primary" type="submit">登录</button>
<button class="btn btn-large btn-primary" type="submit">注册</button>
</fieldset>
</form>