Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

date format in html

Posted on 2008-06-11
5
Medium Priority
?
182 Views
Last Modified: 2010-04-09
Hi
when i am writing a form in html i have a date field and i want to put in input type="text" name="date" size="10"  maxlength='10'  and at the same i want to put for example   /  /   to strict the user to use 07/06/2008 not an empty field otherwise the user can put anything 07.06.08 or he can put 07-06-08 etc...
0
Comment
Question by:asaidi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 10

Expert Comment

by:bluefezteam
ID: 21758849
why dont you have 3 fields with 2 characters in each

[DD] / [MM] / [YY]

alternatively you could draw a back ground image with the /  /  drawn on it and apply it to your field and limit it to 6 characters in length....

[     /      /     ]
0
 
LVL 10

Expert Comment

by:bluefezteam
ID: 21758854
with the first method your form can then join the date together to the format you wish
DD/MM/YY
0
 
LVL 10

Expert Comment

by:bluefezteam
ID: 21758865
!!! obviously with the first method I am implying that you add the / / in between the fields as HTML text
0
 

Author Comment

by:asaidi
ID: 21759737
means  i add value in my input type
input type="text" name="date" size="10"  maxlength='10'  value '  /  /   '
0
 
LVL 10

Accepted Solution

by:
bluefezteam earned 2000 total points
ID: 21759791
no sorry you would write the code below, so that you have 3 small fields for each part of the date. when you submit the results to your form, the back end code can join them together
<input type="text" name="day" size="2"  maxlength='2'  value="dd" /> / <input type="text" name="month" size="2"  maxlength='2'  value="mm" /> / <input type="text" name="year" size="2"  maxlength='2'  value="yy" />

Open in new window

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question