HighDots Forums  

Re: How to implement mm/dd/yyyy format for textbox?

Javascript JavaScript language (comp.lang.javascript)


Discuss Re: How to implement mm/dd/yyyy format for textbox? in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
michael elias
 
Posts: n/a

Default Re: How to implement mm/dd/yyyy format for textbox? - 06-06-2005 , 05:15 AM






Well it is possible but it involves some scripting. My approach is to
create a div element that contains several absolute positioned
textboxes and spans. In HTML it looks like this;

<div style="position:relative;
width:200px;height:24px;background-color:white; border:solid blue 1px">
<input type="text"
style="position:absolute;left:2px;top:2px;height:2 0px;width:28px;border:solid
black 0px" maxLength="2"/>
<span
style="position:absolute;left:24px;top:2px;width:3 px;height:20px"
Quote:
/</span
input type="text"
style="position:absolute;left:30px;top:2px;height: 20px;width:28px;border:solid
black 0px" maxLength="2"/>
</div>

This will give you the desired effect of a masked input. You can use a
pattern as an input parameter and parse it with regular expressions to
create your masked input. Use the onkeypress event on the textboxes to
validate the typed characters.



Reply With Quote
  #2  
Old   
McKirahan
 
Posts: n/a

Default Re: How to implement mm/dd/yyyy format for textbox? - 06-06-2005 , 07:45 PM






"dyw55a" <dyw55a.1q8abz (AT) no-mx (DOT) forums.yourdomain.com.au> wrote

Quote:
Thank you for your reply. This looks like a great idea. But how do
you think if it is possible not using the DIV tag? If you build a .net
web server control, you might not be able to use <DIV>, right? Any more
thought on this?


--
dyw55a
Try reposting your question in a .NET newsgroup.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.