Hello,
I have a drop-down using a collection of code/description combinations. The user needs to select the code from the drop-down, at which point the related description should be displayed in a text box. I believe that the onchange parameter should execute a javascript that loads the related description to a field in the form, but I'm not sure how to do this. Any help will be greatly appreciated!
Collection: therapyArrayList
therapyCode
therapyDesc
Code in
JSP:
<html:select property="therapyCode1" onchange="setTherapyDesc1(this)" size="1">
<html
ptions collection="therapyArrayList"
property="therapyCode"
labelProperty="therapyCode"/>
</html:select>
Javascript (this doesn't work - any ideas on what it should be):
<script type="text/javascript" language="javascript">
function setTherapyDesc1(control)
{
Index=control.selectedIndex
document.Form.therapyDesc1.value=therapyArrayList.therapyDesc.options[control.selectedIndex].value;
}
</script>