MVC Datatype Currency trigger numeric keypad

前端 未结 1 2003
执笔经年
执笔经年 2020-11-29 14:29

My Model has a Dataype(Datatype.Currency) whic is a decimal object.

I am trying to force the view to trigger a Numeric keypad on ipad/iphone when the user clicks int

相关标签:
1条回答
  • 2020-11-29 14:37

    The EditorFor() method does not support adding htmlAttributes unless your using MVC-5.1 or higher. If you are the the syntax is

    @Html.EditorFor(m => m.BidPrice, new { htmlAttributes = new { @type= "number" } })
    

    If your not, then you will need to use the TextBoxFor() method to add the attribute

    @Html.TextBoxFor(m => m.BidPrice, new { @type= "number" })
    
    0 讨论(0)
提交回复
热议问题