Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Select problem

 
Derek Drever
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have the following code:
<script language="Javascript">
function unselectId()
{
document.update.id.options[document.update.id.selectedIndex].selected = false;
}
</script>
<html:select onchange="unselectId()" property="type">
<html ptions collection="Type" property="value" labelProperty="label"/>
</html:select>
<html:select property="id" size="7" >
<html ptions collection="Name" property="value" labelProperty="label"/> </html:select>
I am trying to unselect anything selected on the id list when something is selected on the type list, but the code fails. I would be gratefull for any suggestions.
Regards,
Derek.
 
Junilu Lacar
Bartender
Pie
Posts: 8830
81
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try setting selectedIndex = -1 instead.
 
Derek Drever
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried that and it had no effect, any other ideas gratefully received.
 
Derek Drever
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
disregard the previous comment, it worked, thanks for that.
Regards,
Derek.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic