Populate value in 2nd textbox based on value in the 1st box using Javascript

Posted by Laghaterohan under JavaScript on 4/13/2011 | Points: 10 | Views : 4480 | Status : [Member] | Replies : 1

I have 2 textboxes for entering financial year...
In firstbox when i enter 2010 my second box should automatically list 2011. if i enter 2009 in my first box ,2010 should appear in my second box and so on...

i want this to be done via javascript...

Best Regards,
Rohan Laghate


Posted by: Walia_jagwinder on: 4/13/2011 [Member] Starter | Points: 25

Call this function on onblur event of textbox1

function fillsecond() {
document.getElementById("txt2").value = parseInt(document.getElementById("txt1").value) + 1;


One person's data is another person's program.

Laghaterohan, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response