Two Laptop Bag*
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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
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: 4457
    
    6

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]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to submit a page on change of Combo using Struts