473,548 Members | 2,683 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 7714
"dyw55a" <dy***********@ no-mx.forums.yourd omain.com.au> wrote in message
news:dy******** ***@no-mx.forums.yourd omain.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.valu e);
}
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(th is)">
</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.yourd omain.com.au> wrote in message
news:dy******** ***@no-mx.forums.yourd omain.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**@assistedso lutions.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;hei ght:24px;backgr ound-color:white; border:solid blue 1px">
<input type="text"
style="position :absolute;left: 2px;top:2px;hei ght:20px;width: 28px;border:sol id
black 0px" maxLength="2"/>
<span
style="position :absolute;left: 24px;top:2px;wi dth:3px;height: 20px"
/</span>

<input type="text"
style="position :absolute;left: 30px;top:2px;he ight:20px;width :28px;border:so lid
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.yourd omain.com.au> wrote in message
news:dy******** ***@no-mx.forums.yourd omain.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
9516
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 in advance.
5
8386
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 a date entered. The contents of this field (and others) need to be written back to a SQL database. The 'date' field will be input in the format...
13
3288
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 to configure server, sql server or program so it always deals with date as mm/dd/yyyy format. Thanks in advance. Roy
9
70647
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 'Date' which has the format 'YYYY-MM-DD'. Is there any way I can store the date in the 'DD-MM-YYYY' or just 'DD-MM-YY' format?
3
2878
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
1696
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
30248
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 Thanks in advance
3
3986
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 convert this format to dd/MMM/yyyy, can anybody provide me some help or what can i do please suggest me...
1
4405
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" TargetControlID="TextBox6" Mask="99/99/9999 99:99:99" MessageValidatorTip="true" ...
0
7438
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7803
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5362
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5082
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3495
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3475
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1926
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1051
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
751
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.