Date format

Hi all, I need some help to force a spesific date format for an input field.
All I can find is function relating to US date format (mm/dd/yyyy) but I need it specifically for dd/mm/yyyy

Here is the code:

In need it for "Start_Date" and "End_Date". If someone can suggest changes to my code please?

	<form method="post" action="">
		Leave Type <select name=Leave_Type>
			<option value="Annual">Annual</option>
			<option value="Sick">Sick</option>
			<option value="Family Res">Family Res</option>
		</select> </br></br>
	Start Date  <input type=text name=Start_Date></input> dd/mm/yyyy</br></br>
	End Date    <input type=text name=End_Date></input> dd/mm/yyyy</br></br>
	<p><input type="submit" name="submit" value="Submit" /></p>
	<p><input type="submit" name="history" value="History" /></p>
	<p><input type="submit" name="back" value="Back" /></p>
	<p><input type="submit" name="logout" value="Log Out" /></p>
	<a href="mailto:<?php echo $epos ?>?subject=Web leave application for <?php echo $_SESSION['username']?>&body=Kindly process my leave request" >Inform HR (optional)</a>

Open in new window

Pierre KAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Radek BaranowskiFull-stack Java DeveloperCommented:
I guess you can't really tell the difference, aside from user taking your hint (dd/mm/yyyy) seriously.

How possibly can you tell 07/07/2000 from 07/07/2000 ? :)
Pierre KAuthor Commented:
Good comment - but some Users sit on the ears and don't use their eyes :)
I do reply on them taking the hint but I should probably let the code think for them??
So you saying there is no solution?
Maybe I must at least check for the '/' in the right places
Will give it some time for other comments if you don't mind
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
I guess you're trying to validate the date fields and want them to be validated in the format of dd/MM/yyyy?

if yes, then you can refer to this resources:

Date Formatting And Format Validation

Look at the Parsing section.

copy their js file and do your own validation from there.
Radek BaranowskiFull-stack Java DeveloperCommented:
Yes, there are plenty of validation functions, I'm just saying these two formats are so alike.

anyway, in HTML5 you can use native 'date' input type, and it takes it from there without you worrying about validation:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Pierre KAuthor Commented:
Thanks guys - sure I'll come right now
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.