• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

Button value is not getting passed when submit button is disabled

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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.
 
All of life is a contant education - Eleanor Roosevelt. Tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic