• 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

Struts Action called twice

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
[Thumbnail for script.JPG]
image
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Lavanya,
your problem here is <input type="image"
make it "<img"
and have fun!!!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic