Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Input Masks

Status
Not open for further replies.

kafka

Programmer
Oct 17, 2000
27
0
0
US
Hi Guys,

I need some help creating an input mask for a date entry field. I would like the user to have the delimeters automatically pop up as they type in a date, or even have the delimeters pre-populated.

Listed below is the input which I would like to apply the input mask. I am pretty sure I can use javascript, but I don't know how to do it in javascript. What I am looking for is how to write that date javascrtipt function, and then how to call it correctly when the page loads.

<CFINPUT type=&quot;text&quot; name=&quot;datetoday&quot; size=&quot;12&quot; maxlength=&quot;12&quot; validate=&quot;date&quot; onError=&quot;checkdate&quot; >


I also need to get a input mask for currency. Again, listed below is the un-input mask text field.

<CFINPUT type=&quot;text&quot; name=&quot;fare&quot; size=&quot;12&quot; maxlength=&quot;12&quot;>

Cheers,

gumby
 
Instead of using Javascript to loop check the input to these form fields, why not just break up the required fields into separate ones? You would have 3 inputs for the date (month, day, year), and 2 for currency (dollars, cents).

Then you can validate each input and tie them all together before you enter them into your database.

-Tek
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top