String action = <form instance>.getAction(); // action set by hidden variable in jsp page
String option = <form-instance>.getOption(); // option set by hidden variable in jsp page
if the action is equal to the action specified in the form's hidden variable and option is equal to option specified in the forms hidden variable, then retrieve the selected value of the first select box and populate the arrayList of options for the second select box.
I hope this makes sense.
>From: Robin Whitley <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
>Date: Tue, 28 Aug 2001 23:25:50 -0400
>Received: from [18.104.22.168] by hotmail.com (3.2) with ESMTP id MHotMailBD55ABD5004540043217407D85140B790; Tue, 28 Aug 2001 20:26:13 -0700
>Received: (qmail 11536 invoked by uid 500); 29 Aug 2001 03:24:58 -0000
>Received: (qmail 11524 invoked from network); 29 Aug 2001 03:24:58 -0000
>Received: from greensboro.bondisoftware.com (22.214.171.124) by daedalus.apache.org with SMTP; 29 Aug 2001 03:24:58 -0000
>Received: by COSMO with Internet Mail Service (5.5.2653.19)id ; Tue, 28 Aug 2001 23:25:51 -0400
>From struts-user-return-16241-cn081 Tue, 28 Aug 2001 20:27:23 -0700
>Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
>Delivered-To: mailing list [EMAIL PROTECTED]
>X-Mailer: Internet Mail Service (5.5.2653.19)
>X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
>I have a form that has a selection box for country. If "UNITED STATES" is
>selected, the form has a stateProvince selection box that should be
>populated with "state" options. If "CANADA" is selected, the stateProvince
>selection box should be populated with the "province" options. I use
>struts_logic:equal based on the "country" bean property
>to accomplish this. The form populates the struts_html:options from a
>collection. The logic works properly if there is an initial value for
>country. However, when the country option is changed, the onchange event
>What I tried to do in the fillStateProvince function was to test the
>selected option for country, and set the value on the bean, hoping that this
>would set my struts_html:options properly. My sysouts indicate that when
>the form loads, it sets the country value to UNITED STATES and then to
>CANDADA, but that when I change country, the function doesn't fie.
>I've included the pertinent code. My question, is this the proper way to
>handle this or is there a better way to accomplish the same result.
>logic that is causing this result.
>Any help would be appreciated.
><%@ page language="Java" contentType="text/html; charset=UTF-8"
><%-- In the form - country -- %>