473,395 Members | 1,554 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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


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

I have text box with format mm/dd/yyyy. Now I want the cursor i
generated whenever user highlight this textbox and whatever user inpu
replace one of char in "mm/dd/yyyy" one at a time.

I will be appreciated if anyone could give me some idea to implemen
this through JavaScript.

thanks,
Am

--
dyw55
-----------------------------------------------------------------------
dyw55a's Profile: http://www.highdots.com/forums/member.php?userid=14
View this thread: http://www.highdots.com/forums/showthread.php?t=142895

Jul 23 '05 #1
6 7705
"dyw55a" <dy***********@no-mx.forums.yourdomain.com.au> wrote in message
news:dy***********@no-mx.forums.yourdomain.com.au...

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

I have text box with format mm/dd/yyyy. Now I want the cursor is
generated whenever user highlight this textbox and whatever user input
replace one of char in "mm/dd/yyyy" one at a time.

I will be appreciated if anyone could give me some idea to implement
this through JavaScript.

thanks,
Amy
--
dyw55a


AFAIK, what you want (if I understand it) can't be done.

I think you want each succcessive position to be highlighted for
replacement.

If not, please clarify your requirements.

Here's is some code I started with:

<html>
<head>
<title>mmddyyyy.htm</title>
<script type="text/javascript">
var what = "mm/dd/yyyy";
function mdy(that) {
if (what != that.value) {
alert(that.value);
}
what = that.value;
}
</script>
</head>
<body>
<form action="" method="get">
<input type="text" size="10" maxlength="10"
name="mmddyyyy" value="mm/dd/yyyy" onkeyup="mdy(this)">
</form>
</body>
</html>
As an alternative, popup calendars are often used to select dates.
Jul 23 '05 #2

Thank you for your reply.

Actually please check this web server control's demo:
http://www.assistedsolutions.com/com...InputMask.aspx

I want to implement something like that. I did everything bu
encountered some problem on updating the textbox. Only the way thi
control used to update the text one by one like the link could preven
my current issues.

thanks again,
Am

--
dyw55
-----------------------------------------------------------------------
dyw55a's Profile: http://www.highdots.com/forums/member.php?userid=14
View this thread: http://www.highdots.com/forums/showthread.php?t=142895

Jul 23 '05 #3
"dyw55a" <dy***********@no-mx.forums.yourdomain.com.au> wrote in message
news:dy***********@no-mx.forums.yourdomain.com.au...

Thank you for your reply.

Actually please check this web server control's demo:
http://www.assistedsolutions.com/com...InputMask.aspx

I want to implement something like that. I did everything but
encountered some problem on updating the textbox. Only the way this
control used to update the text one by one like the link could prevent
my current issues.

thanks again,
Amy

--
dyw55a


Try contacting them:
in**@assistedsolutions.com
Jul 23 '05 #4
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"
/</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.

Jul 23 '05 #5

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

--
dyw55
-----------------------------------------------------------------------
dyw55a's Profile: http://www.highdots.com/forums/member.php?userid=14
View this thread: http://www.highdots.com/forums/showthread.php?t=142895

Jul 23 '05 #6
"dyw55a" <dy***********@no-mx.forums.yourdomain.com.au> wrote in message
news:dy***********@no-mx.forums.yourdomain.com.au...

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.
Jul 23 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: CyberLotus | last post by:
Hi, I wish to validate the date a user has entered against the format dd-mmm-yyyy using the CompareValidator, but it does not work. Does anybody have a simple solution please? Many thanks...
5
by: Ben Williams | last post by:
Hello, I'm hoping i'm posting to the correct newsgroup - this question involves both a SQL database and VB. I am a newbie and i'm writing a program in which one of a handful of fields will have...
13
by: Roy | last post by:
Hi all, I'm creating a project that should always use this date format when displays the dates or create dates. The back end database is a SQL Server and I like to know what is the logical way...
9
by: abctech | last post by:
Helo, I have a calendar on my webpage on which the date format is 'DD-MM-YYYY'; user selects a date and it has to be stored in the same format in the backend; but I checked in MySQL there is...
3
by: Eric Layman | last post by:
Hi, In general, how do u configure/script to allow .net to accept date in dd/mm/yyyy format? By default, my sys only allows mm/dd/yyyy format. Eg: Take alook at
2
by: jaydeepsinh | last post by:
Hi, I have a SQL server 2000 as database. From database i want retrive date in dd/mm/yyyy format. i m using .net 1.0 and C#.. Can anyone help me..regarding this. Thanks in advance.
4
by: Ashraf Ansari | last post by:
Hi, How Can I convert MM/dd/yyyy format into dd/MM/yyyy and the date which is converted into dd/MM/yyyy should be in DateTime format. I do not want to store it as a string. Please help ...
3
by: neoupadhyay | last post by:
Hi Friends, I am Using ASP.NET1.1 and i want to convert the system date, in dd/MMM/yyyy format. Earlier i use lblDate.Text = System.DateTime.Now.AddMinutes(30).ToString(); But i want to...
1
maliksleo
by: maliksleo | last post by:
Hi i am using this ajex <asp:TextBox ID="TextBox6" runat="server" Width="180px" ValidationGroup="MKE" /> <ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender6" runat="server" ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.