Hi,
I am having problems with ie7 with picklists and dynamically adding
items to select lists. In the picklist case, the selected items don't
appear visibly in the right list, but the values selected are actually
submitted when the form is submitted. I have a similar problem when
dynamically adding to a select list from a text field . Looks like the
javascript is not working. Other javascript like the calendar stuff
works fine.
For example the following jsp stuff works perfectly with ie6 and
firefox but not in ie7 . I am using appfuse 1.9.4 with struts
<td>
<select name="opSelected" multiple="multiple" id="opSelected"
size="7" style="width: 270px">
<c:if test="${opSelected != null}">
<c:forEach var="list" items="${opSelected}" varStatus="status">
<option value="<c:out value="${list}"/>">
<c:out value="${list}" escapeXml="false"/>
</option>
</c:forEach>
</c:if>
</select>
</td>
<td>
<html:text property="op" maxlength="20"/>
</td>
<td>
<input type="button" value="+" onclick="addOp(opSelected)" />
</td>
<td>
<input type="button" value="-" onclick="delOp(opSelected)" />
</td>
With java script
function addOp(list)
{
var newItem = document.createElement("option");
var newOp = document.getElementById("op");
var newMatchRule = document.getElementById("opMatchRule");
newItem.value = newMatchRule.value + newOp.value ;
newItem.text = newMatchRule.value + newOp.value ;
list.add(newItem);
}
function delOp(list)
{
list.remove(list.selectedIndex)
}