TextBox验证只允许一个点和一个点。在特定的地方.. [英] TextBox Validation to allow only a single dot & at specific place..

查看:88
本文介绍了TextBox验证只允许一个点和一个点。在特定的地方..的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿伙计们我想要验证一个文本框,它应该只允许在特定的地方放一个点...



例如,如果我有最大的文本框长度10比点只能在位置8输入一次,如下所示。



1024587.12



或者,如果我的长度为5的文本框应该是第3个,如下所示,



10.24





您的帮助将得到真正的赞赏和关注。



注意......应该只有一个点而不是更多。

Hey guys I want to validate a textbox which should only allow a single dot in it on a specifc place...

e.g if i have textbox of max length 10 than dot can only be entered once at position 8 like below.

1024587.12

OR if i have textbox of length 5 than it should be on 3rd like below,

10.24


Your kind help will be really appreciated and regarded.

NOTE...There should only be a single dot and not more.

推荐答案

目前我正在使用以下



\d {1,13} \。 \ {1,2}





取1-13长度的第一位数,最大值为秒2lenght和之间的一个点。
Currently I am using the following

"\d{1,13}\.\d{1,2}"


Which took first digit of 1-13 length and second of max 2lenght and a dot between.


这篇关于TextBox验证只允许一个点和一个点。在特定的地方..的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆