Thursday, March 22, 2012

Masking

Can any one tell me how to hard code a input mask so users can only input data in a certin format? For example say I want users to input data in the format of #####-#####.

Thank you in advance to all those that help.There's a free control on the control gallery right here on ASP.NET that can do that:

http://www.asp.net/ControlGallery/ControlDetail.aspx?Control=1447&tabindex=2
Thanks, but I can't seem to get the control to properly install to be used in the web matrix environment. Any sugestions?
Try posting a question to the control creator's site:

http://www.eworldui.net/Forums/default.aspx
I'll try that, thanks
http://www.geocities.com/patoooey2001/code/code.html
There are several masked input controls in the Control Gallery. Some are specific to IE, due to the extra features IE offers that make for a better mask. A mask feature is only good when the browser supports the javascript and javascript is enabled. So be sure to setup a validator to confirm that the entry is valid by the time you try to save it on the server side.

In the case of #####-#####, I'd use a regularexpressionvalidator with the expression:
^\d{5}\-\d{5}$

FYI: My product,Professional Validation And More, provides several filtering textboxes that handle many browsers.

0 comments:

Post a Comment