aspose file tools*
The moose likes Struts and the fly likes Struts Action called twice Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Action called twice " Watch "Struts Action called twice " New topic
Author

Struts Action called twice

Lavanya Mothilal
Ranch Hand

Joined: Dec 27, 2007
Posts: 30
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 ?


Thanks,<br />Lavanya
Arun Christopher
Greenhorn

Joined: Nov 18, 2008
Posts: 19
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



[Thumbnail for script.JPG]

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Dec 07, 2009
Posts: 1
Lavanya,
your problem here is <input type="image"
make it "<img"
and have fun!!!


Darshana Bhandare
[]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts Action called twice