[Javascript] Q on SELECT Options

Peter Brunone peter at brunone.com
Thu Feb 6 21:58:22 CST 2003


Walter,

	What is it that's not working?

-Peter

|-----Original Message-----
|From: javascript-admin at LaTech.edu [mailto:javascript-admin at LaTech.edu]On
|Behalf Of Walter Torres
|
|I have 2 lists.
|
|I am trying to make it so that when you select an item in LIST_A, the item
|selected in LIST_B (if any) is deselected and the focus to stay in LIST_A.
|
|This is what I have, but it's not working.
|
|Thanks
|
|walter
|
|<select name='master' size='7' onFocus='setListFocus(this)'>
|   ... options here
|</select>
|
|// global to store what list is currently in focus
|var objFocusList;
|
|// Set Focus and remove focus from other List
|function setListFocus ( objList )
|{
|	if ( objList == objFocusList)
|		return
|
|	if ( typeof ( objFocusList ) == 'object' )
|		
|objFocusList.options[objFocusList.selectedIndex].selected = false;
|
|	objFocusList = objList;
|}



More information about the Javascript mailing list