• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to make an Image click just like a Submit button

 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I have a button which is a DHTML simulated button. I want to make that one like submit button (which will call the action-mapping).

But i dont want to use any href links.

Please give me an idea.

Thanks

Mahendran
 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have used in this manner

<html:image src="your.gif" property="submit" />

this will work for you..
 
Mahendran Aiyappan
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for replying Mr.Sreenivas,

I need to do a custom calendar for my project. It has all the months as a button aligning vertically. If i click one month for Example MAR then 1 table with 5 rows and 7 columns <td> and <tr> I have to generate.

The Question for me is I have multiple buttons should call the same action with a parameter to diffentiate it.

Would you suggest me any idea for this.

Mahendran.
 
sreenivas jeenor
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mahendran,

your idea is good,have a single action for all the buttons,call with different parameters.

Sreenivas
 
Mahendran Aiyappan
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sreenivas,

It is basically a table in which all <td> behave like a button.

But the problem i am facing right now is - How to link an onClick() method <td> to behave like a submit button in Struts.

I am not using any <html:link ...> inside.


Mahendran.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In HTML, the <td> element itself supports an onclick event.
 
Mahendran Aiyappan
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Merrill Higginson

Thanks for the reply,

Could you sent me any examples or links where onClick() behaves like a submit button (should call the actions in struts).

Mahendran A
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

[ March 06, 2007: Message edited by: Merrill Higginson ]
 
Mahendran Aiyappan
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Merrill Higginson,

Thanks for your code snippet,

I have another doubt.

In my project I have Security constraints in Web.xml (such as roles and usernames etc). So my question is whether this will block the javascript code.

Mahendran A
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The server will treat a form submitted with JavaScript no differently than a form submitted with a standard submit button. All the server-side code knows is that a form was submitted. It will therefore use the same rules to determine whether a user has access to a given action or not.
 
Mahendran Aiyappan
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Merrill

It was a wonderful comment.

Mahendran A
 
I've never won anything before. Not even a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic