aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Button value is not getting passed when submit button is disabled Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Button value is not getting passed when submit button is disabled" Watch "Button value is not getting passed when submit button is disabled" New topic
Author

Button value is not getting passed when submit button is disabled

SuprajaY Yasoda
Greenhorn

Joined: Oct 17, 2005
Posts: 17
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 ]
merwin pinto
Ranch Hand

Joined: Feb 16, 2005
Posts: 39
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

Joined: Oct 17, 2005
Posts: 17
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Button value is not getting passed when submit button is disabled
 
Similar Threads
form bean value not getting
selecting dynamically added rows of a table
Prevent the page refreshing
Handling Multiple Submits
How to pass javasript variable to java scriplet in side jsp?