0

So I currently have a jade file that displays the value pulled from the db for every input field when someone goes to edit his profile, but I am having trouble displaying the birthday aka date.

This is my jade file:

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

The data is being pulled in Node.JS and rendered with the page from the backend.

Lion789
  • 4,402
  • 12
  • 58
  • 96
  • What is the problem you are facing ? The date you are setting is not showing. According to this http://stackoverflow.com/questions/6982692/html5-input-type-date-default-value-to-today, it needs to be in a particular format. So check if it is in right format. – user568109 Jul 15 '13 at 03:53
  • When a user goes to this page everything is filled with there info except for the birthday, which shows up with this value mm/dd/yyyy and I saw that post but I am not sure how to work with it. – Lion789 Jul 15 '13 at 17:08
  • The format of date in value has to be YYYY-MM-DD. Use dash instead of slash. Also check if you are giving it a valid date. – user568109 Jul 15 '13 at 17:30
  • user.birthday.getYear() + "-" + user.birthday.getMonth() + "-" + user.birthday.getDay() I just modified my code to pull that from the db then I am calling it as a variable ubirthday as a value in the input field but it still just shows as mm/dd/yyyy without any values replacing it – Lion789 Jul 15 '13 at 17:46

1 Answers1

0

have you tried to use '#{ufirstName}' instead of ufirstName?

value='#{ufirstName}' should give the input a default value of ufirstName (atleast it works for me for me), sorry if I was unclear!

tobbe202
  • 1
  • 1