dcsimg
VERY URGENT! <html:select property="selectedCategory" onchange="return submitForm(this.form);">
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Joyce_Cheang
Posted On:   Thursday, November 28, 2002 08:27 AM

Hi, please help!
i have 2 select boxes. the second one depends on the first one. after user select the first one, i need to do a onchange event and submit to the Action class to retrieve the information for the second select box. however, i encountered a javascript error, something like: "Object not supported" when i select a value from the first select box. Why is this so? below is my code:

			




...




Re: VERY URGENT! <html:select property="selectedCategory" onchange="return submitForm(this.form);">

Posted By:   Raji_D  
Posted On:   Saturday, November 30, 2002 09:16 AM

Hi,
U can try this.Two ways are there
1 ) .function submitForm()
{
document.forms[0].action = 'pathofactionclass/youraction.do?actionType=retrieve'
document.forms[0].submit;
}
Where 'pathofactionclass/youraction.do' is the name of ur action class along with its path. and actionType is a parameter which you can read in ur action class to recognise that the action class is being invoked on change as follows:
String actiontype = request.getParameter("actionType");
if(actiontype ="retrieve")
{
/*do whatever you want to do when on change of your select option*/}

2).Another way what i am doing is:The values of the second combo box will be fully obtained in action class.Keep this in session.I get the values of the second box too on load of the jsp itself and keep it initially itself in the client side.Then when the first combo changes you need not go to the action class but just change the values of the second combo box using javascript itself.[U can use collection to populate the second combo)
About | Sitemap | Contact