This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Struts and the fly likes How to submit a page on change of Combo using Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "How to submit a page on change of Combo using Struts" Watch "How to submit a page on change of Combo using Struts" New topic
Author

How to submit a page on change of Combo using Struts

Moinder Tank
Greenhorn

Joined: Jun 16, 2003
Posts: 2
I have tried <html:select property="ordId" onchange='document.forms[0].submit()'> but it didn't work, then I replace ' quotes with " quotes then also it didn't work giving error on submit() function, then i tried <html:select property="ordId" onchange="alert(document.forms[0].submit)">, it returns the object.
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4118
    
    2

You are probably getting a conflict between your submit button and the javascript submit method.
In your ActionForm, add a String field called action + getter/setter. Your submit tags should then use the property attribute, like so:
<html:submit property="action">Submit</html:submit>
This will take care of the conflict and your javascript should work.


Junilu - [How to Ask Questions] [How to Answer Questions] [MiH]
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How to submit a page on change of Combo using Struts
 
Similar Threads
Dependent drop down list
select: on change action and retaining values
show different content after a choice in a combobox
html:options onclick
Retaining selected value in html:select on page refresh