Click to See Complete Forum and Search --> : display value from a previous field


dinram
12-30-2003, 10:40 PM
Hi Friend,
I have attached an html file.
From the page, you can see that I have 1 list box and 1 text box in 2 rows.
My requirement is, say the user selects "India", enters something in the "Search data" text box and then goes to the 2nd row and clicks(through keyboard or mouse)the list box, now I want "India" to be the value in the 2nd list box.In short, whichever country the user had selected in the previous list box, that same country should get displayed in the following list box too.
You have any idea on how to do this?
Your help in this will be very much appreciated.
Regards,
Dinesh.

Khalid Ali
12-30-2003, 11:09 PM
//getting a value form a list box

suppose form name form1
var frm = document.form1;
//get value
va firstvalue = frm.listboxName.options[frm.listboxName.selectedIndex].value;
now you can easily set the value to second list box

dinram
12-30-2003, 11:47 PM
Thank you Khalid.Though I have been able to get the value of 1st list box, how do I set the this value to the 2nd list box now?
Regards,
Dinram.

dinram
12-31-2003, 12:13 AM
Thank you Khalid.Though I have been able to get the value of 1st list box, how do I set the this value to the 2nd list box now?
Regards,
Dinram.

fredmv
12-31-2003, 02:08 AM
Give it a different name and access it as shown above but using the different name.