473,387 Members | 1,456 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,387 software developers and data experts.

Auto Format Date

Hi i need a javascript code that can auto format the dates to dd/mm/yy format ie., if you type in 270506 in the textbox, it should automaticaly convert it to 27/05/06

I need this script urgently.

Thanks in advance.
Jul 6 '06 #1
1 4448
acoder
16,027 Expert Mod 8TB
If str is the value of the textbox:
Expand|Select|Wrap|Line Numbers
  1. newVal = str.substring(0,2) + "/" + str.substring(2,4) + "/" + str.substring(4);
Apr 28 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Dwalker | last post by:
I just want to enter today's date in a text input box with the format mm/dd/yyyy when it receives focus. I've been playing around with this but just can't seem to get it to work. Any help would...
2
by: MVA | last post by:
Hi all I have a database where in a table (tbl_Members), there are 2 date fields (DateOfBirth and DateJoined), and also 2 fields which upon entering the data in the form, it automatically works...
5
by: Laertes | last post by:
Hi, I have created a DB and I want to set up a few read-only users. The problem is that I have a few "automated" insert/delete procedures. E.g. when the user logs in his name is recorded on a...
2
by: Edwin Knoppert | last post by:
I would like to instruct a grid which autofill's the columns to exclude time or date from a date field when date or time is 0. Date and time can be stored in a date field, my grid shows for...
6
by: | last post by:
Hi, can someone provide some advise on how to get around with using auto generated proxies? basically I already have the proxy classes, and they are used by other places. I'd like use these...
5
by: mbyrd1332 | last post by:
Just wondering if any of you knew of a way to trap the <!-- #BeginDate format:Am1 -->April 4, 2006<!-- #EndDate --> (Dreamweaver's Auto-Update-on-Save Date Code) into a PHP variable and still have...
6
by: AA Arens | last post by:
Hi, I have a database with 2 main forms. Contacts and companies. I share the base with two others via LAN. On the companies form I have buttons to navigate throught the records (>400). We are...
4
by: =?Utf-8?B?cm9kY2hhcg==?= | last post by:
hey all, i have a gridview that have auto columns on. Well one of the fields is a date field which shows the time by default. Is there a way to format without the time when Auto Columns are on? ...
2
by: Irving Guy | last post by:
Hi all, I’m trying to create a form with 15 fields that generates an auto number in one of those 15 fields. The auto generated number which should display like this – “081-2008-00001”...
9
zimes
by: zimes | last post by:
I am working with Microsoft Access 2003 from the Office XP pro suite. I have created several tables that have to do with Asset tracking along with purchasing. I have a table called Purchasing,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
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
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...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.