文本框编号的设置 [英] Settings for Textbox number
本文介绍了文本框编号的设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的表单上有几个文本框。我将属性值TextMode设置为Number,现在我在文本框中有这个滚动条。有没有办法从文本框中删除滚动条,仍然让文本框只接受数字?
I have a form that has a couple of textboxes on it. I set the properties value TextMode to Number and now I have this scrollbar in the textbox. Is there a way to remove the scrollbar from the textbox and still have the textbox to only accept numbers?
<asp:TextBox ID="TextBoxTRIR" runat="server" Width="180px" TextMode="Number"></asp:TextBox>
推荐答案
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="TextBoxTRIR"
ErrorMessage="Please Enter Only Numbers" ValidationExpression="^\d+
> < / asp:RegularExpressionValidator >
试试这个:
数字验证:使用JavaScript在TextBox中仅接受数值(数字) [ ^ ]
:) :) :))
Try this :
Numeric Validation: Accept only numeric values ( numbers ) in TextBox using JavaScript[^]
:) :) :)
这篇关于文本框编号的设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文