File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts Action called twice

 
Lavanya Mothilal
Ranch Hand
Posts: 30
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using an image with an <a> tag (like the one below) to submit a form with the help of javascript.



After the form submits using the "deletedetails" method, some times the action is called twice which leads to some undesired results (like trying to delete an already deleted record from a database). As I mentioned, this behaviour is not consistent and at times the action is called only once as desired.

Anyone know the reason behind this ?
 
Arun Christopher
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I know this is too late for the reply.

But i feel someone will find this helpful.

move the onclick function to href tag like the code in the image attached



This will work perfectly.


Thanks,
Arun
script.JPG
image
[Thumbnail for script.JPG]
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You attached an image of some code rather than just typing it in or cut-and-pasting?!?! Come on.
Of course, this isn't really what you'd want to do, because it would be useless for those with JavaScript turned off, or sites that must maintain accessibility for legal or ethical reasons.

@OP: Asking a JavaScript question without any actual JavaScript is a suboptimal approach.

I also don't see any reason to use an image input there if all you really need is an image.
 
Darshana Bhandare
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lavanya,
your problem here is <input type="image"
make it "<img"
and have fun!!!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic