- 浏览: 222557 次
- 性别:
- 来自: 武汉
-
文章分类
- 全部博客 (148)
- ext (3)
- flex (22)
- css (4)
- struts (5)
- test (1)
- spring (8)
- jquery (4)
- eclipse plugin (4)
- ant (2)
- JSP (7)
- java (15)
- blaze (1)
- html (4)
- jquery js (9)
- 测试 testDirector 设置 windows7 ie9 (1)
- flex twaver (1)
- flex twaver (1)
- 网管系统 (1)
- 数据库 mysql (1)
- HTML5 (2)
- 测试 (1)
- js (6)
- 软件方法 软件管理 (1)
- jquery jqgrid (3)
- flex xml (1)
- jquery validation (1)
- 网址 (3)
- spring security (2)
- 学习列表 (1)
- java 建站 (1)
- firefox 插件 (1)
- 非技术 (1)
- 百度地图 API (2)
- ajax (1)
- 3D (1)
- 矩阵 (1)
- WAP (6)
- 百度地图 (1)
- 模拟器 (1)
- eclipse (2)
- tomcat (2)
- eclipse j2ee (1)
- 天气预报 (1)
- API (2)
- ruby (1)
- Rails (2)
- jquerymobile (1)
- 股票 (1)
- goagent (0)
- 代理 (0)
- GitHub (1)
- 代码托管 (1)
- 安装 (1)
- maven (1)
- MVC (1)
- 面试题 (1)
- java 排序 算法 (1)
- java 算法 堆排序 (1)
- AS3 (1)
- html5 css3 (1)
- j2ee (1)
- 数据库 oracle (1)
- 显卡 (1)
- json (1)
- 笔记本选购 (0)
- 华硕 笔记本 USB (1)
- word (1)
- 试音音源 (1)
- junit (1)
- Quartz (1)
- 模拟 (0)
- nodejs (0)
- 12306 (1)
- 内存调整 (1)
- 正则表达式 (2)
- 金融 (1)
- easyui (1)
- oracle (0)
- sql (0)
- 设计模式 (1)
- 报表 (1)
- linux (1)
- windows (1)
- ftp (1)
- JWTs (0)
- JBPM4 (0)
- 对账 (1)
- 银企直连 (1)
- 商户 (1)
- 支付宝 (1)
- ljk (0)
- webservice (1)
- git (1)
- js vue (1)
最新评论
-
喵喵大神:
免费股票数据查询API:https://www.juhe.cn ...
股票数据接口API -
surfingll:
谢谢啦,有用
ajaxAnywhere局部刷新(一) -
631134230:
怎么设置饼图 不要爆炸式进场动画效果
amcharts js 制作柱状统计图和饼图 -
musicbox95351:
可以自己用ajax请求数据后,在回调方法里面去执行AmAngu ...
amcharts js 制作柱状统计图和饼图 -
pandatyut:
大神,请问amchart的仪表盘AmAngularGauge能 ...
amcharts js 制作柱状统计图和饼图
可以让用户只能输入数字、大写字母、小写字母
对于手机上的输入框的格式限制还是太简单了些。没办法。
以下来源
http://blog.mant.com.cn/?action=show&id=416
对于作者提到的输入小数的问题我打算将一个输入框分成两个处理。如果不对文本框输入内容做限制,用户输入数字时切换输入法相当麻烦。
The -wap-input-format WCSS property takes a number of format characters as its value. The format characters specify the type and number of characters that can be entered in a text field. The -wap-input-format WCSS property should be applied to the <input type=”text”>, <input type=”password”> and <textarea> tags. There will be no effect if it is applied to other XHTML MP tags. The property value of -wap-input-format is called the input mask.
The following table shows the format characters available (format characters are case-sensitive):
Format characters Usage
a It is used to represent any lowercase letter or symbolic character.
A It is used to represent any uppercase letter or symbolic character.
n It is used to represent any numeric or symbolic character.
N It is used to represent any numeric character.
x It is used to represent any lowercase letter, numeric or symbolic character.
X It is used to represent any uppercase letter, numeric or symbolic character.
m It is used to represent any character. The WAP browser is in lowercase input mode by default but can be changed to uppercase input mode.
M It is used to represent any character. The WAP browser is in uppercase input mode by default but can be changed to lowercase input mode.
Here are two WAP CSS examples that illustrate the usage of the -wap-input-format property:
-wap-input-format: “NN”
Meaning: You must enter 2 numeric characters in a text field with this WAP CSS style rule applied.
-wap-input-format: “AAAAA”
Meaning: You must enter 5 uppercase letters or symbolic characters in a text field with this WAP CSS style rule applied.
The input mask must be enclosed in double quotes or single quotes since the -wap-input-format property takes a string value. Note that single quotes do not work in Openwave Mobile Browser 6.2.2. For example, the following markup does not work properly in Openwave Mobile Browser 6.2.2:
<input type=”text” style=”-wap-input-format: ‘N’”/>
You have to change it to the following markup so that the input mask is enclosed in double quotes:
<input type=”text” style=’-wap-input-format: “N”‘/>
It is a good practice to set an input mask for an input field, since the input mode (alphanumeric mode, numeric mode, etc) of a mobile phone’s keypad will be set automatically according to the input mask. It is a very convenient feature for the users of your mobile Internet application. For example, if the input mask is “NN” (it specifies that the text field can only accept 2 numeric characters), a mobile phone’s keypad will be set to numeric mode automatically. If you press a key of the mobile phone, no alphabets or symbols can be outputted.
You can add a single numeric character before a format character in an input mask. For example:
-wap-input-format: “2N”
It means a user can enter a maximum of 2 numeric characters in a text field. (Notice that the meaning of “2N” is different from that of “NN”.)
Also, you can add the * character before a format character in an input mask. For example:
-wap-input-format: “*N”
It means there is no limit in the number of numeric characters that can be entered.
Another example is:
-wap-input-format: “A*a”
It means the user must:
enter one uppercase character (or symbolic character), and then
enter zero or more lowercase character (or symbolic character)
The input mask “A*a” can be applied to text fields that are used to obtain a name from the user. It ensures that the first character must be in uppercase. For example, the user can only enter “Peter” but not “peter”.
The default value of the -wap-input-format WCSS property is “*M”.
The following two rules should be followed when adding a numeric character or the * character before a format character:
You can only use such character combination once in the input mask.
You can only use such character combination at the end of the input mask.
Here are some examples of invalid WCSS style rule:
-wap-input-format: “9N9N” — Reason: You can only use 9N once in the input mask.
-wap-input-format: “*Naa*N” — Reason: You can only use *N once in the input mask.
-wap-input-format: “9NNNN” — Reason: You can only use 9N at the end of the input mask. The correct format should be “NNN9N”.
-wap-input-format: “*NA” — Reason: You can only use *N at the end of the input mask.
If a value of invalid syntax is assigned to the -wap-input-format property, WAP browsers will ignore the property.
Escaped characters can be included in an input mask. To escape a character, you put two backslashes (i.e. ) in front of that character. (Note: The Openwave Mobile Browser 6.2.2 does not follow the correct WCSS language syntax. It uses a single backslash for character escaping.)
Why do we need escaped characters in the input mask? Look at this example and you will understand. Let’s say you want a user to enter a date of the form MM/DD/YYYY and you specify “NN/NN/NNNN” (or “NN/NN/NNNN” for Openwave Mobile Browser 6.2.2) as the input mask. If the user use Openwave Mobile Browser, the / character will be inserted automatically at the third and the sixth character position of the text field as he/she types the date. If the user use the Nokia Mobile Browser, the / character will not be inserted automatically but the browser will forbid the user to enter characters other than / at the third and the sixth character positions. The input mask in this example ensures that the third and sixth characters must be /.
(A note for mobile Internet application developers who are familiar with WML 1.x:
Character escaping in the -wap-input-format property value is different from that in the format attribute value of WML 1.x. Two backslashes are used to escape a character in the -wap-input-format property value while a single backslash is used for the same purpose in the format attribute value. For example, the following XHTML MP markup:
<input type=”text” style=’-wap-input-format: “bN”‘/>
is equivalent to the following WML 1.x markup:
<input type=”text” format=”bN”/>
You have to use two backslashes in WCSS because a backslash is a special character in the WCSS language. To let a backslash character to be part of a property value, it has to be escaped by another backslash. This means if you specify -wap-input-format: “bN” in the cascading style sheet, the WCSS processor will treat it as -wap-input-format: “bN”.)
我使用的结果还可以,但是只能是纯数字,不能输入小数点,纠结啊...
对于手机上的输入框的格式限制还是太简单了些。没办法。
以下来源
http://blog.mant.com.cn/?action=show&id=416
对于作者提到的输入小数的问题我打算将一个输入框分成两个处理。如果不对文本框输入内容做限制,用户输入数字时切换输入法相当麻烦。
引用
The -wap-input-format WCSS property takes a number of format characters as its value. The format characters specify the type and number of characters that can be entered in a text field. The -wap-input-format WCSS property should be applied to the <input type=”text”>, <input type=”password”> and <textarea> tags. There will be no effect if it is applied to other XHTML MP tags. The property value of -wap-input-format is called the input mask.
The following table shows the format characters available (format characters are case-sensitive):
Format characters Usage
a It is used to represent any lowercase letter or symbolic character.
A It is used to represent any uppercase letter or symbolic character.
n It is used to represent any numeric or symbolic character.
N It is used to represent any numeric character.
x It is used to represent any lowercase letter, numeric or symbolic character.
X It is used to represent any uppercase letter, numeric or symbolic character.
m It is used to represent any character. The WAP browser is in lowercase input mode by default but can be changed to uppercase input mode.
M It is used to represent any character. The WAP browser is in uppercase input mode by default but can be changed to lowercase input mode.
Here are two WAP CSS examples that illustrate the usage of the -wap-input-format property:
-wap-input-format: “NN”
Meaning: You must enter 2 numeric characters in a text field with this WAP CSS style rule applied.
-wap-input-format: “AAAAA”
Meaning: You must enter 5 uppercase letters or symbolic characters in a text field with this WAP CSS style rule applied.
The input mask must be enclosed in double quotes or single quotes since the -wap-input-format property takes a string value. Note that single quotes do not work in Openwave Mobile Browser 6.2.2. For example, the following markup does not work properly in Openwave Mobile Browser 6.2.2:
<input type=”text” style=”-wap-input-format: ‘N’”/>
You have to change it to the following markup so that the input mask is enclosed in double quotes:
<input type=”text” style=’-wap-input-format: “N”‘/>
It is a good practice to set an input mask for an input field, since the input mode (alphanumeric mode, numeric mode, etc) of a mobile phone’s keypad will be set automatically according to the input mask. It is a very convenient feature for the users of your mobile Internet application. For example, if the input mask is “NN” (it specifies that the text field can only accept 2 numeric characters), a mobile phone’s keypad will be set to numeric mode automatically. If you press a key of the mobile phone, no alphabets or symbols can be outputted.
You can add a single numeric character before a format character in an input mask. For example:
-wap-input-format: “2N”
It means a user can enter a maximum of 2 numeric characters in a text field. (Notice that the meaning of “2N” is different from that of “NN”.)
Also, you can add the * character before a format character in an input mask. For example:
-wap-input-format: “*N”
It means there is no limit in the number of numeric characters that can be entered.
Another example is:
-wap-input-format: “A*a”
It means the user must:
enter one uppercase character (or symbolic character), and then
enter zero or more lowercase character (or symbolic character)
The input mask “A*a” can be applied to text fields that are used to obtain a name from the user. It ensures that the first character must be in uppercase. For example, the user can only enter “Peter” but not “peter”.
The default value of the -wap-input-format WCSS property is “*M”.
The following two rules should be followed when adding a numeric character or the * character before a format character:
You can only use such character combination once in the input mask.
You can only use such character combination at the end of the input mask.
Here are some examples of invalid WCSS style rule:
-wap-input-format: “9N9N” — Reason: You can only use 9N once in the input mask.
-wap-input-format: “*Naa*N” — Reason: You can only use *N once in the input mask.
-wap-input-format: “9NNNN” — Reason: You can only use 9N at the end of the input mask. The correct format should be “NNN9N”.
-wap-input-format: “*NA” — Reason: You can only use *N at the end of the input mask.
If a value of invalid syntax is assigned to the -wap-input-format property, WAP browsers will ignore the property.
Escaped characters can be included in an input mask. To escape a character, you put two backslashes (i.e. ) in front of that character. (Note: The Openwave Mobile Browser 6.2.2 does not follow the correct WCSS language syntax. It uses a single backslash for character escaping.)
Why do we need escaped characters in the input mask? Look at this example and you will understand. Let’s say you want a user to enter a date of the form MM/DD/YYYY and you specify “NN/NN/NNNN” (or “NN/NN/NNNN” for Openwave Mobile Browser 6.2.2) as the input mask. If the user use Openwave Mobile Browser, the / character will be inserted automatically at the third and the sixth character position of the text field as he/she types the date. If the user use the Nokia Mobile Browser, the / character will not be inserted automatically but the browser will forbid the user to enter characters other than / at the third and the sixth character positions. The input mask in this example ensures that the third and sixth characters must be /.
(A note for mobile Internet application developers who are familiar with WML 1.x:
Character escaping in the -wap-input-format property value is different from that in the format attribute value of WML 1.x. Two backslashes are used to escape a character in the -wap-input-format property value while a single backslash is used for the same purpose in the format attribute value. For example, the following XHTML MP markup:
<input type=”text” style=’-wap-input-format: “bN”‘/>
is equivalent to the following WML 1.x markup:
<input type=”text” format=”bN”/>
You have to use two backslashes in WCSS because a backslash is a special character in the WCSS language. To let a backslash character to be part of a property value, it has to be escaped by another backslash. This means if you specify -wap-input-format: “bN” in the cascading style sheet, the WCSS processor will treat it as -wap-input-format: “bN”.)
我使用的结果还可以,但是只能是纯数字,不能输入小数点,纠结啊...
发表评论
-
页面中调用手机拨号
2013-02-21 15:02 870包括判断设备类型 http://istyles.blog.16 ... -
WAP 2.0 页面模板及事件处理
2013-01-16 16:19 1279对于select的事件 <?xml version= ... -
WAP 模拟器
2013-01-16 12:30 745opviewWave 优点是比较稳定。 http://prog ... -
WAP开发 百度地图静态图API
2013-01-16 11:42 5269由于在WAP2.0中也没有实现强大的交互功能,在现实地图的时候 ... -
WAP 教程 网址备忘
2013-01-14 18:05 797http://www.w3school.com.cn/wap/ ...
相关推荐
js输入框字数限制提醒
unigui限制正数输入框 -限制位数++.rar
jquery实现输入框字数限制代码,简单适用,美观大方。
UnityWebGL唤醒手机输入框,安卓和苹果已测试。https://blog.csdn.net/abcd5711664321/article/details/125384825?spm=1001.2014.3001.5502
自己做的文本框字数统计/限制插件 输入框 或者 文本域 动态显示还剩余可输入字数
还不错,手机WAP使用的日期选择,功能不错。
VUE指令输入框整数限制
UITextfield输入框限制的功能封装
unigui限制正数输入框 -限制位数.rar
js 特效 html 特效 多输入框字母限制 js 特效 html 特效 多输入框字母限制
前台文本框输入的时候对该文本框的字数自动截取,输入框字数限制。
HTML5输入框字数限制提示代码,超出字数限制,输入框,左右晃动效果。
HTML5输入框字数限制提示特效是一款当超过限制字符时,输入框抖动效果代码。
内容索引:脚本资源,jQuery,jQuery插件,表单,输入框 使用jQuery 限制表单输入框的字符格式,并自动按要求转换格式,我们把它起个名字叫做jQuery inputMask,它一共有四种方式: 1、转换文本框的字符为大写,自动...
jquery.mask.js是一款jQuery输入框限制输入内容格式插件。该插件可以通过指定的规则来限制用户在输入框中输入的内容,例如限制日期格式,限制电话号码格式等,非常实用。
一个自定义弹出输入框(输入长度限制),GitHub 地址:https://github.com/marsdan/ZPPOPTextField.git
多输入框字母限制.rar
html5实现输入框字数限制提示抖动效果.zip
利用js控制多行文本框字数