0

Hi, I am using 2 text box. one text box contains date (25/04/2011 format),when i focus on 2nd text box it should show month of 1st text box. please give me the code for it

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by metalix
0

Hey there.
Firstly.
when posting on forums you will usually get better response when you use kind wording.
e.g: can any one help me with this code, rather than give me the code.

and this is how it's done:

<script type="text/javascript">
function month(){
	var date = document.getElementById('date').value;
	var curr_month = parseFloat(date.substring(3,5));
	var month=new Array(12);
	month[1]="January";
	month[2]="February";
	month[3]="March";
	month[4]="April";
	month[5]="May";
	month[6]="June";
	month[7]="July";
	month[8]="August";
	month[9]="September";
	month[10]="October";
	month[11]="November";
	month[12]="December";
	document.getElementById('month').value=month[curr_month];
}
</script>

<input id="date" type="text" value="25/04/2011" /><br />
<br />
<input id="month" type="text" value="" onfocus="month()" />
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.