2017-02-27 38 views
0

添加蒙版,以InputTags我有我的观点input-tag,但我想设定屏蔽每个标签:digit-digit ,如:1-3,44-56如何在asp.net mvc5

我如何设置?

回答

0

,你可以做这样的

首先两个库的头

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> 
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.maskedinput/1.4.1/jquery.maskedinput.js"></script> 

然后在下面将是你textbox

@Html.TextBoxFor(x => x.Number, new { @class = "form-control", @id = "phone" }) 

这里x.Number将财产 和脚本将是

<script type="text/javascript"> 
     $(function() { 
      $("#phone").mask("99-99"); 
     }); 
    </script> 
+0

感谢您的帮助,但您的帮助是为文本框....我想为taginput中的每个标记设置掩码 – Saman

+0

您可以显示有问题的代码吗? – Usman