如何在文本框中接受浮点值? [英] how to accept a float value in textbox?
本文介绍了如何在文本框中接受浮点值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在文本框中接受浮点值?
这意味着仅接受数字值和''.''值
在桌面应用程序中
解决方案
尝试此 [ ^ ].
使用比较验证器
< asp:textbox id = " runat = " xmlns:asp = " #unknown" </ asp:textbox > < asp:comparevalidator id = " runat = " controltovalidate = " 运算符 = " type = " errormessage = " 值必须为浮点数" xmlns:asp = #未知" />
在该文本框的前面放置一个正则表达式,并控制该文本框的位置.
goto属性并执行此操作....
验证表达式:^([0-9].[0-9])*
how to accept a float value in textbox?
that means accept only numeric values and ''.'' value
in desktop application
解决方案
Try this[^].
Use Compare validator
<asp:textbox id="textbox11" runat="server" xmlns:asp="#unknown"></asp:textbox> <asp:comparevalidator id="intValidator" runat="server" controltovalidate="textbox1" operator="DataTypeCheck" type="float" errormessage="Value must be float" xmlns:asp="#unknown" />
put one regular expression in front of that textbox and control that text box which ever it is.
goto properties and do this....
validate expression: ^([0-9].[0-9])*
这篇关于如何在文本框中接受浮点值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文