• 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

Handling Multiple Submits

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I am quite new to Struts. I wrote a java script
function. Which gives user a alert to avoid clicking submit
button again and again






when jsp is submitted from checkAttachStatus function it
is getting submitted, but when I submit it from submits
function isTokenValid(req) is returning false and its not
showing the next, Any suggestion on this Pls. I know that
it returns flase if seesion is missing or token is valied how to check this?
function checkAttachStatus(strValue)
{
if(document.getElementById ("hdnAttachmentStatus"))
{
if(document.getElementById("hdnAttachmentStatus").value=='false')
{
alert("The Files indicated in red did not get uploaded properly. Please upload them again or remove them.");
return false;
}
}
checkVisited
('FBAuction','2','Submit');
//alert("strValue 111: "+strValue)
// alert("strLinkSubmit 111 : "+document.forms[0].strLinkSubmit.value)
// alert("strSubmit 111 : "+document.forms[0].strSubmit.value)
//submits(strValue)
}

function submits(strValue) {
alert(strValue)
document.FBAuction.strLinkSubmit.value = strValue;
//document.forms[0].strSubmit.value = strValue;
// alert(confirmed)
if (confirmed==true)
{
//alert("strLinkSubmit 222 : "+document.forms[0].strLinkSubmit.value)
document.forms[0].submit();
confirmed=false;
}
else if(confirmed==false)
{
alert("Page Already Submitted,Please wait.");
document.FBAuction.strLinkSubmit.value = strValue;
// document.forms[0].strSubmit.value = strValue;
}
}
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you ever call saveToken before enterring the jsp? If there is no token to check against it will of course return false.
 
SuprajaY Yasoda
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the response, I tried by using saveToken(req, but still am facing the same problem. So I disabled the button after clicking it once, its working for 4,5 jsp's but in once JSP, submit button value is not getting passed to actionbean. Can you please suggest me on this.
 
reply
    Bookmark Topic Watch Topic
  • New Topic