473,480 Members | 2,172 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Date Text box

Hi,

I need Javascript text boxt which automatically includes space and
character for date when anyone comes text box should looks like
'yyyy-mm-dd'. When pressing each character converting in to typed
number.
Thanks a lot.

Feb 24 '06 #1
5 3903
pjSoni wrote:
I need Javascript text boxt which automatically includes space and
character for date when anyone comes text box should looks like
'yyyy-mm-dd'. When pressing each character converting in to typed
number.


There's a lot of masking codes on the internet, on my site there are two
that you can take a look:

#1 <URL:http://jsfromhell.com/forms/restrict>: My friend has done this
one, it also checks the current character position, so it works
reasonably right.

#2 <URL:http://jsfromhell.com/forms/masked-input>: I was taking a look
at this old code and it's horrible, I'll change as soon as I get some
motivation... =/
--
Jonas Raoni Soares Silva
http://www.jsfromhell.com
Feb 24 '06 #2
Jonas Raoni wrote:
[...]

#1 <URL:http://jsfromhell.com/forms/restrict>: My friend has done this
one, it also checks the current character position, so it works
reasonably right.


Hey presto, the biggest issue with XHTML - all I see of your page is an
error:

"XML Parsing Error: mismatched tag. Expected: </li>. Location:
http://jsfromhell.com/forms/restrict Line Number 241, Column 73:

than the mask, the "extra" characters of the mask will be ignored.</p>
------------------------------------------------------------------------^

"

--
Rob
Feb 25 '06 #3
RobG wrote:
Jonas Raoni wrote:
[...]

#1 <URL:http://jsfromhell.com/forms/restrict>: My friend has done this
one, it also checks the current character position, so it works
reasonably right.


Hey presto, the biggest issue with XHTML - all I see of your page is an
error:


And anyway, the masking code won't work because you can't tell in
javascript where in a field the cursor is. The scripts use the
field.length attribute, so will work only when typing at the end of a
field, not when you've arrowed or moused back into it to edit it.

You can't really do this very well on keypress, you have to do it on change.
Feb 26 '06 #4
TheBagbournes wrote:
RobG wrote:
Jonas Raoni wrote:
[...]
#1 <URL:http://jsfromhell.com/forms/restrict>: My friend has done this
one, it also checks the current character position, so it works
reasonably right.


Hey presto, the biggest issue with XHTML - all I see of your page is an
error:


And anyway, the masking code won't work because you can't tell in
javascript where in a field the cursor is.


Yes, you can.
PointedEars
Feb 26 '06 #5
RobG wrote:
Jonas Raoni wrote:
[...]

#1 <URL:http://jsfromhell.com/forms/restrict>: My friend has done this
one, it also checks the current character position, so it works
reasonably right.


Hey presto, the biggest issue with XHTML - all I see of your page is an
error:
"XML Parsing Error: mismatched tag. Expected: </li>. Location:


I was changing some things internally and I ended up damaging some
codes, I've perceived and fixed just two days after haha, if you want,
try the link again =b
--
Jonas Raoni Soares Silva
http://www.jsfromhell.com
Feb 28 '06 #6

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

Similar topics

8
3611
by: John Wildes | last post by:
Hello all I'm going to try and be brief with my question, please tell me if I have the wrong group. We are querying transaction data from a DB3 database application. The dates are stored as...
3
8805
by: Ivan V via DotNetMonster.com | last post by:
Dear All: I got a serious problem in updating the date field from vb.net to abd dbf file. My code is as follow: Dim ConnectionString As String Dim cake As Date = Date.Parse(idate) ...
9
2234
by: newtophp2000 | last post by:
I need to add the ability for the users to select a date on one of our web pages. The examples I was given by some users were in JavaScript. Is there a free date picker that I can use? I saw one...
5
3042
by: Řyvind Isaksen | last post by:
I have a page with an optional integer-field, and one asp:calendar control. I use a stored procedure to save the data in SQL Server. When all fields contains data, the code works great! But if the...
6
12513
by: Luvin lunch | last post by:
Hi, I'm new to access and am very wary of dates as I have limited experience in their manipulation and I know if they're not done properly things can turn ugly quickly. I would like to use a...
0
2710
by: oneplace | last post by:
I have the following script that use for the following after i have made my search for a name in my database. I select the name and it bring up this from with all the information of the person. It...
3
3273
by: Jim in Arizona | last post by:
I have a gridview that's being populated from an access db query. The problem I'm having is that the date/time fields in access that are populating the gridview are showing both date and time, when...
6
2874
by: NH | last post by:
I want to allow users to enter dates in a text box in either the US "MM dd yy" format or the UK "dd MM yy" format. But how can I validate these dates? All the date functions e.g. ISdate,...
3
4475
by: Bob Sanderson | last post by:
I have a PHP web page which uses a HTML form. I would like to enter dates into the date fields using a JavaScript calendar, similar to the way phpMyAdmin does. Can anyone recommend a JavaScript...
7
2083
by: creative1 | last post by:
Hello everyone. I am experiencing a strange problem that I can't fix on my own. I think I need expert's suggestions for this. The problem is: I want to print account statement (or any other...
0
7052
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,...
1
6744
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...
0
5348
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4790
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...
0
3000
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...
0
2989
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1304
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 ...
1
565
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
188
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...

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.