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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Editmask in HTML

Status
Not open for further replies.

DeSn

Programmer
Joined
Nov 20, 2001
Messages
111
Location
BE
Does anyone knows if there exists something like an editMask in HTML?

I want to create an inputfield with the following date-editmask: __/__/____ in a website.

D.
 
I'm not quite sure if your looking for this, but hé....

<SCRIPT type=&quot;text/javascript&quot; >
function theDate(){
var day = new Date();
var m = day.getMonth(); if (m<10) {m=&quot;0&quot;+m;}
var y = day.getYear();
var d = day.getDay(); if (d<10) {d=&quot;0&quot;+d;}
document.form.date.value=d+&quot;/&quot;+m+&quot;/&quot;+y;
}
-->
</SCRIPT>

<body onload=&quot;theDate();&quot;>
<form method=post action=&quot;&quot; name=&quot;form&quot;>
<input type=&quot;text&quot; name=&quot;date&quot;>
</form>
</body>

Quasibobo

Don't eat yellow snow!
 
There is no such thing as &quot;editMask&quot; (e.g. as in MS Access), but of course you can validate or/and restrict input in the HTML input fields using JavaScript.

regards,
rydel n23
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top