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

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()" />
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.