Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

how i can have 2 Action for one Form with image as button?

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for reading my post
Hi how i can use an Struts Image as a button to call some action ?
I have two action wich i should decide about them on user click .
e.g : a login form with a register and logIn button . i want to use image as buttons
what is solution pleas.


Thank you.
[ June 01, 2005: Message edited by: Ramina Nibilian ]
 
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Include the image using struts image tag and write little script onclick of the image button and submit the form. In javascript you can decide which action depending on the event.
 
Ramina Nibilian
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Thank you for reply
I do Not know the Script required here.
could you pleas give me a link to web page or post required script
here ?
where should i write the script ?


Thank you.
 
Srilakshmi Vara
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First let me know what type of actions you want on two different submits
 
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See here. That shows you how to set up a form to use ImageButtonBeans. Then use a DispatchAction to dispatch on the property of your form which determines which button was pushed. So if you follow the example and have a getSelected() method for instance, then you can have your DispatchAction specify parameter="selected" in your <action-mapping> element.
 
get schwifty. tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!