Posted By:
david_crocker
Posted On:
Wednesday, November 5, 2003 01:58 PM
I want to change a field on a form when a user selects an option from a select tag. The value that I would like to change the form field to is stored in an array. When the user makes a selection I would like to change the form field value. I have tried to use the following code, but can not get it to work. Here is what I tried first: onchange="this.form.requestDescription.value = ' <%= requestDescription['parseInt(this.options[this.selectedIndex].value)']%>" I never got that to work. I am now wanting to call a javascript function, but do not know how to use a jsp variable in the function. Can this be done? Is there a better way? I do not want to submit the form to get the field value changed. Th
More>>
I want to change a field on a form when a user selects an option from a select tag. The value that I would like to change the form field to is stored in an array. When the user makes a selection I would like to change the form field value. I have tried to use the following code, but can not get it to work. Here is what I tried first:
onchange="this.form.requestDescription.value = '
<%= requestDescription['parseInt(this.options[this.selectedIndex].value)']%>"
I never got that to work. I am now wanting to call a javascript function, but do not know how to use a jsp variable in the function. Can this be done? Is there a better way? I do not want to submit the form to get the field value changed.
Thanks for any help!
<<Less