Web custum control

  • Thread starter Thread starter Karl Jensen
  • Start date Start date
K

Karl Jensen

Hello gurus,
I would like to build a text box like date field in the following format
:dd-mm-yy. My thougts are that this should be possible with a web custum
control or by inheriting from a text box and override the render method to
get the desired effect.
Can anyone tell me if i'am on the right way or not. And if not , were should
i look instead.


Thanks in advance
 
Not quiet , i want to display " -- -- " in a textbox like control with
tab navigation beetwenn fields the box.
A user should then be able to fill in the fields like this:
"12--03--04" .
Make sens?
 
It is very tricky to build the necessary javascript that maintains fixed
text (the dashes) within a textbox and moves the insertion point along.
Simply put, HTML wasn't designed to do that. To my knowledge, IE's DHTML
library comes closest to giving you the tools that allow modifing the
inserting point and replacing characters in text.

I recommend letting users enter text in your format and reformatting as they
exit the field. That's what I did in my commercial DateTextBox property,
"Peter's Date Package" (http://www.peterblum.com/datecontrols/home.aspx). In
my case, I developed the ability for the user to omit separators and have
the code re-insert them during reformat. For example, if they type "0312",
the software reformats to 03-12-2004 (determining the year from other
rules.) Peter's Date Package fully supports localization of date formats.
You specify your desired ShortDatePattern and DateSeparator.

--- Peter Blum
www.PeterBlum.com
Email: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
 
Back
Top