asp.net mvc - add data to my html mvc part -
it such have add data-val used birthday indicating when have fødelsedag. have check add plain html mvc html part, have tried this.
it causes problems @ 2 using data-* , can not pardon enter it.
@html.textbox("txtfornavn", null, new { @class = "form-control input-lg", placeholder = "fornavn", data-val="true", data-val-required="date required", type = "date" })
normally, html part this.
<input type="date" class="form-control input-lg" data-val="true" data-val-required="date required">
i have written here, , works fine out problems.¨
@html.textbox("txtfornavn", null, new { @class = "form-control input-lg", placeholder = "fornavn", type = "date" })
i have try here:
the link posted gave answer. have use underscore _
if want use dashes in attribute name
@html.textbox("txtfornavn", null, new { @class = "form-control input-lg", placeholder = "fornavn", data_val="true", data_val_required="date required", type = "date" })
did try that?
Comments
Post a Comment