Jump to content

input masks without javascript


uncleronin

Recommended Posts

is it possible to create input masks without using javascript? I know a common practice is to split up textfields so that a user sort of gets an idea of what to expect. This and actually displaying the mask in both the textfield and the associated label [like D.O.B (dd/mm/yyyy): ...] are also useful but still don't stop stupid people from being stupid and misentering information or entering in letters were there should be only numbers.

 

I guess what I'm really asking is if there is a way to either prevent certain characters from being entered AND enforcing that certain characters be entered in certain positions WITHOUT javascript? With javascript this is incredibly easy but without it all hell breaks loose *waves first at company with javascript enabled*

 

Anybody got any ideas on the best non-JS 'inpuy masking' or on actual masking? *sigh*

Link to comment
https://forums.phpfreaks.com/topic/38747-input-masks-without-javascript/
Share on other sites

You can't do that client side BUT once the info is sent you should validate it in your script anyway - that is standrad practice for good code. If any of the data fails validation simply show teh form once more with the invaldi fields highlighted.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.