• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

submit values incorrect in internet explorer

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Rashid Limbada
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic