0

after user make some selection, I want to remove the highlight on the items of the list. I have two usages of select tag and both still have highlighted after click on certain item or items of the list.

Problem is when user select on particular item, there will be pop up box. If the user just close the pop up and select on that same item, the pop up won't show. If the user put some input to pop up box, the selection of item will be disappear though.

How can I achieve to remove the highlight on the items of the select tag list?

1)

<select name="top" onchange="showMeasurement(this.options[this.selectedIndex].value,'m');" multiple class="selection-big">
<c:forEach var="f" varStatus="i" items="${fItemList}">
<option value="<c:out value="${f.fItemId}"/>~<c:out value="${f.fCategoryId}"/>~<c:out value="${f.fName}"/>~<c:out value="${f.fPName}"/>" ><c:out value="${f.fName}"/></option>
</c:forEach>
</select>

2)

<s:select id="bList" name="bIds" list="bList" listKey="key" listValue="value" multiple="true" cssClass="selection-big-short" theme="simple" 
    onchange="changeVal(this.options[this.selectedIndex].value,'m');"/>
kitokid
  • 3,009
  • 17
  • 65
  • 101
  • 1
    _"both still have focus"_ - I don't see how they could: by definition the focus will be on only one field at a time (whichever field, if any, is currently responding to keyboard input). Do you mean that you want to clear the selection? If so can you please be a bit more specific about exactly when you want to clear it. – nnnnnn Oct 19 '12 at 01:28
  • I think you are mistaking the highilghting showing which options are selected for focus (these are multiple selects). You must keep that highlighting so users know which options they've selected. If you want to de-select all options, set the select element's `selectedIndex` property to `-1`. – RobG Oct 19 '12 at 01:33
  • This could help you: http://stackoverflow.com/questions/1857781/best-way-to-unselect-a-select-in-jquery – Alex Oct 19 '12 at 03:06

0 Answers0