开发者

Input validation into text box

Is there anyway I can ensure users enter amounts into a text box lik开发者_StackOverflowe £XX,XXX,XXX in line with up to 99million pounds.

Thankyou


There might be a HTML5 solution to this, but to ensure that it works cross browser you have to use javascript. You can write something yourself or use a plugin.

This one is based on jQuery and I think it will do the work for you: http://digitalbush.com/projects/masked-input-plugin/


Javascript:
http://www.elated.com/articles/form-validation-with-javascript/

You also can use php (if people disable javascript), which should be fairly easy by using preg_match with some regexp.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜