所以我当前有一个玉文件,当有人去编辑他的个人资料时,显示每个输入字段从数据库中提取的值,但是我在显示生日日期时遇到了问题。
这是我的玉文件:
extends layout
block content
div.centerContent
form.validateForm(method="POST", action="/editUserProfile")
legend Edit Profile
input(type="text", name="firstName", maxlength="20", placeholder=ufirstName, value=ufirstName)
br
input(type="text", name="lastName", maxlength="20", placeholder=ulastName, value=ulastName)
br
input(type="email", name="email", maxlength="20", placeholder=uemail, value=uemail)
br
input(type="number", name="phone", maxlength="20", placeholder=uphone, value=uphone)
br
input(type="date", name="birthday", placeholder=ubirthday, value=ubirthday)
br
input.btn.btn-primary(type="submit", name="Update", value="Save")
a(href="/userProfile")
button.btn(type="button") Cancel
数据正在Node.JS中提取,并使用后端的页面进行渲染。
答案 0 :(得分:0)
您是否尝试使用'#{ufirstName}'而不是ufirstName?
value ='#{ufirstName}'应该给输入一个默认值ufirstName(至少它适合我),抱歉,如果我不清楚的话!