Why it doesn't work:
<input type="text" name="givenName" <% if(givenName) {%> value="<%= givenName %>" <% } %>/><br/>
It throws a reference error indicating that givenName is undefined, which may or may not be, and is the reason for the conditional.
source
to share