Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Struts
Search Coderanch
Advance search
Google search
Register / Login
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
Forum:
Struts
Handling double submission in Struts 2
zimbu bolleddu
Ranch Hand
Posts: 35
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi all,
Im new to
struts
,
how to handle double submission in struts.
or
how to disable submit button after first click.
please give me some code example
Thanks in advance
Vilmantas Baranauskas
Ranch Hand
Posts: 89
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
One way is to implement this using JavaScript on client side:
var formSubmitted=false; function preventDoubleSubmit() { if(formSubmitted) { return false; } formSubmitted = true; return true; } <form ... onsubmit="preventDoubleSubmit()">
Author of <a href="http://www.newsinjector.com" target="_blank" rel="nofollow">NewsInjector</a>
zimbu bolleddu
Ranch Hand
Posts: 35
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thank you for your reply,
but it is not working.
Actually my requirement is :
When I click on Submit button it should be disable
Vilmantas Baranauskas
Ranch Hand
Posts: 89
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
If you want to disable submit button visually you may do following:
var formSubmitted=false; function preventDoubleSubmit() { if(formSubmitted) { return false; } var submitButton = document.getElementById("id-of-submit-button"); submitButton.disabled=true; // or submitButton.style.display="none"; formSubmitted = true; return true; }
Author of <a href="http://www.newsinjector.com" target="_blank" rel="nofollow">NewsInjector</a>
zimbu bolleddu
Ranch Hand
Posts: 35
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Yeah it's working fine.
Thank you very much ...!
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
struts
Crystal Report Error with Struts
Synchronized token patteren in J2EE
Idempotent.
Struts 2: Forms with multiple submit buttons - Best Practice?
More...