Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Masking input text for phone #, date, etc.

843835Dec 25 2001 — edited Nov 4 2009
Hi All,

This may not be related to jsp, but since I am using it, I decided to post here.

I have a jsp page which is basically a form to enter some database data.

What I would like is to force the user to enter correct data such as phone number, fax number, date, using a mask in the input type = "text" name = ...
eg.
phone (03)9876-1234
phone: (xx)yyyy-zzzz

The same applies for date:
DD/MM/YYYY

Can we somehow initialise the value of the text with brackets and dashes, so the user is forced to enter the data in a pre-format

When the user presses submit, I capture the value of the text using request.getParameter(...

Thanks in advance for any help
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 2 2009
Added on Dec 25 2001
4 comments
449 views