...

View Full Version : For loop for searching for the selected Item



tinku
01-27-2005, 04:18 PM
Hi,
I have two list/record, When one item is selected it should check through the other list and if present choose that item and get the focus on the list.
here is the code. Can anyone please help on what exactly I should do here or help in correcting the error.


function getname()
{
for(i=0;i<window.document.custom_form.custbodycust_itemid_list.length;++i)
{
if(window.document.custom_form.custbodycust_itemid_list.options[i].selected){
window.document.custom_form.custbodycust_itemid_list.SelectedIndex = i;
break;
}
}
}

Willy Duitt
01-27-2005, 08:44 PM
Please do not cross-post your questions from one forum to another:
http://www.codingforums.com/showthread.php?t=51085

And yes, pasting the same message with a different subject title IS cross-posting...

.....Willy



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum