使用包含某些特定字符的字母数字验证文本框 [英] Text box validation with alphanumerics with some specific special characters
本文介绍了使用包含某些特定字符的字母数字验证文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
1)如何使用javascript
限制用户只输入$ @ *#
的字母数字,并且还应允许用户点击退格删除和空格
任何帮助?
2)默认情况下如何制作带有3位小数的文本框数量字段/>
即如果用户输入像6这样的蚂蚁数字,它将发布6.000到模型
并且十进制数可以配置
我们如何实现这个
解决方案
@ *#
使用javascript
并且它应该允许用户点击退格删除和空格
任何帮助?
2)默认情况下如何制作带有3位小数的文本框数量字段/>
即如果用户输入像6这样的蚂蚁数字,它将发布6.000到模型
并且十进制数可以配置
我们如何实现这个
输入字符的过滤很简单。请参阅,例如: http://www.javascripter.net/faq/keyboardinputfiltering.htm [ ^ ]。
第二个问题根本没有意义,因为我在答案的评论中解释了这个原因。
-SA
1)How to restrict the user to enter only alphanumerics with $ @ * #
using javascript
and also it should allow user to click backspace delete and space
any help ?
2) How to make text box amount field with 3 decimal by default
i.e if user enters ant digit like 6 it will post 6.000 to model
and the no of decimal could be configurable
How can we achieve this
解决方案
@ * #
using javascript
and also it should allow user to click backspace delete and space
any help ?
2) How to make text box amount field with 3 decimal by default
i.e if user enters ant digit like 6 it will post 6.000 to model
and the no of decimal could be configurable
How can we achieve this
Filtering of input characters is simple. Please see, for example: http://www.javascripter.net/faq/keyboardinputfiltering.htm[^].
The second question simply makes no sense because of the reason I explained in my comment to the answer.
—SA
这篇关于使用包含某些特定字符的字母数字验证文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文