Forum Moderators: open
Here i am facing some problem in disabling the submit button.
The sitaution is :
------------------
Once we click on submit button, i was asking confirmation from user as ok / cancel.
After clicking on Ok,
I should disable submit button to prevent any more submits for the form.
I did some work around over these.After disabling the button, the form is not submitting.
Here the code sniplet i am using .
At : Java Script
function makeVisible(button)
{
if( confirmSubmit())
{
element = document.getElementById(button);
//alert(element);
element.style.visibility = "visible";
document.submitJob.disabled=true;
return true;
}else return false;
}
at html :
<html:submit property="action" onclick="return makeVisible('picture');">"
title="Execute" styleClass="submitLink" styleId="submitJob" >
.......
Here i should first submit and disable .
can any help me in this regard.
Thanks
Srins.
function makeVisible(button)
{
if( confirmSubmit() ) {
var element = document.getElementById(button);
if( element ) {
element.style.visibility = "visible";
}
var submitJob = document.getElementById('submitJob');
if( submitJob ) {
submitJob.disabled=true;
}
return true;
}
else {
return false;
}
}
Note, I added some error checking and also get the submit button to disable using getElementById.