Here is a demo using JS
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<style type="text/css">
</style>
<script type="text/javascript">
function changeDate(){
var currentDate= document.getElementById('date').value; //Extracting the date value in dd/mm/yyyy format from the mentioned text box
alert('The original value: ' + currentDate); //Printing the extracted date value before making the change
var newDate = currentDate.split('/'); //Splitting the extracted date value using the delimiter /, which is the seperator used in the date value
currentDate = newDate[1] + "/" + newDate[0] + "/" + newDate[2];//Constructing a new date value (string) using the splitted values.
alert('Value after the change : ' + currentDate);//Showing the new date value.
}
</script>
</head>
<body>
<form name="f1">
<input id="date" type="text" name="dte" value="07/03/2009" />
<input type="button" id="click" value="click"/>
</form>
<script type="text/javascript">
document.getElementById('click').onclick = changeDate; //Event handler assignment
</script>
</body>
</html>
Hope this helps.
Bookmarks