This is similar to selecting a state, then town, etc...
I resubmit after changing the action value so the servlet knows what to
do next...
Here is the HTML code for it
<!-- this is element 0 -->
<html:hidden property="action" value=""/>
Select Company
<html:select property="companySelection"
onchange="selectChange('Company');" >
<html:option value="">Select a company</html:option>
<html:options collection="companyList" property="orglevel2id"
labelProperty="orglevel2name"/>
</html:select>
Here is the javascript it runs
<script language="JavaScript">
function selectChange(txt) {
document.FormDrillDownReport.elements[0].value = 'changed' + txt;
document.FormDrillDownReport.submit();
}
</script>
-----Original Message-----
From: rear [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 28, 2002 2:38 PM
To: struts-user
Subject: RE: html:select and collection display
Paul,
Thanks for the reply! I tried to get an example of a JSP using
"onchange",
but have not been able to come up with a complete example which also
uses
the <html:select> tag. It would sure be a great help if you could point
me
in the direction of one!
Thanks,
Ron
-----Original Message-----
From: Galbraith, Paul [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 28, 2002 4:37 AM
To: Struts Users Mailing List
Subject: RE: html:select and collection display
Ron, where exactly are you wanting to display the therapyDesc? You'll
want
to use the onClick or onChange javascript event handlers of the
html:select
tag. You'll need to write some javascript that can identify the
therapyCode
and display the matching therapyDesc. I hope that's a start in the
right
direction for you, and I'm not telling you something you already
know...if
you're not sure how to do this, just ask.
Paul
-----Original Message-----
From: Rea, Ron [mailto:[EMAIL PROTECTED]]
Sent: August 27, 2002 1:23 PM
To: '[EMAIL PROTECTED]'
Subject: html:select and collection display
Hello All,
I'm still pretty new to Struts, so maybe this is really simple, but I
can't
figure it out for the life of me. I am displaying a drop-down within a
JSP.
The collection contains a therapyCode and a therapyDesc, the drop-down
displaying the therapyCode. What I need to do is, once the therapyCode
is
selected from the drop-down, also display the therapyDesc for that
therapyCode. Any ideas as to how to do this???
Collection: therapyArrayList
===========================
therapyCode
therapyDesc
Code to display drop-down:
<html:select property="therapyCode1" size="1">
<html:options collection="therapyArrayList"
property="therapyCode"
labelProperty="therapyCode"/>
</html:select>
--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>