This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes submit values incorrect in internet explorer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "submit values incorrect in internet explorer" Watch "submit values incorrect in internet explorer" New topic
Author

submit values incorrect in internet explorer

Rashid Limbada
Greenhorn

Joined: Aug 17, 2007
Posts: 7
Hi

I have create a jsp page with 2 submit buttons: here is the code.

<s:submit type = "button" label="Add Club" name =
"submit" value= "addClub">
</s:submit>
<s:submit type = "button" label="Search" name =
"submit" value = "searchClub">
</s:submit>

Now in firefox, if the Add Club button is pressed, the property submit in my action is correctly set to addClub.
However, in IE if the Add Club button is pressed, the value of submit is "addClub, searchClub".

Is there any way around this problem. I know that I could use 2 separate properties for the buttons.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I'd suggest using a property name other than "submit" such as "submitAction" or something like that. The reason for this is that "submit" has meaning in javaScript, and Struts tags sometimes use JavaScript behind the scenes. This may be what's causing problems in IE.


Merrill
Consultant, Sima Solutions
Rashid Limbada
Greenhorn

Joined: Aug 17, 2007
Posts: 7
Hi Merril

Thanks for the suggestion but unfortunately this still did not work. For some reason IE passes the label names of both buttons to the action. So with my label names Add club and search, I receive the string "Add club, search" in my action. I think this has something to do with the struts tag s:submit.
I guess I will have to use the html submit then.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: submit values incorrect in internet explorer
 
Similar Threads
Struts 2: how to distinguish multiple submit button call in the action class
how to handle mutiple buttons
Struts 2 - Internationalize Submit Text
how to print multiple file uploads in console
JSP page with buttons