I am using ejs for template rendering, I am using below code
<%- input_field_tag('empName', 5) %>
Which generates output as
<input id="empName" value="" type="5" name="empName">
Here the type attribute is set as 5 -- Which actually need to be set as text and value attribute need to be set as 5
I am referring code from ejs_wiki_ViewHelpers, Where they stating that output will be generated as <input id='empName' value='5' type='text' name='empName'/>
Let me know what is going wrong in my code, because I have simply copy pasted it from the docs.
You are probably using
express-helpersmodule which uses different arguments than plain ejs view helpers.The
input_field_tagin express-helpers module takesnameas the first argument,inputTypeas the second one and third is options object.See wiki of this module for more information.