• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Button value is not getting passed when submit button is disabled

 
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 need some suggestions from you experts. I am disabling my submit button when it is clicked once to avoid double submission, but by doing this it's value is not passing to action bean. Please suggest me.
This is javascript code

function doSubmit(submitValue,btnName) {
document.forms[0].strSubmit.value = submitValue;
document.forms[0].submit();
btnName.disabled = true;
alert(document.forms[0].strSubmit.value)
}


alert in my function gives me the exact value but it is not reaching there. I did these for 4,5 JSP's but its not working only for one JSP only. Please suggest me. It's really urgernt for me
[ October 23, 2005: Message edited by: Bear Bibeault ]
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI,
the problem with the code is that ..... you have sumitted the form (document.forms[0].submit() and then you are putting the alert ...
try putting the alert before you submit the form .... since you are submitting the form the button value maybe is getting reset ...
 
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
HI,

Thanks a lot for the reply. I placed the alert before and after submitting the form, at both places I can get the value, which Submit button needs to submit.
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic