J
jeffotn
I have a form that the users continue to click the save button
multiple times. I can sovled this simply by saying the following:
onclick="this.disabled=true"
However the button does not peform a submit.
My jsf button def
<x
anelGroup style="margin-right: 5px;">
<h:commandButton action="#{activeForm.save}" id="save"
value="#{messages['detail_button_save']}" immediate="false"
styleClass="defaultButton" disabled="#{activeForm.noAppliedAmount}"
onclick="return submitDisable();" />
</x
anelGroup>
I can do something like this
var submitted = false;
function submitDisable() {
if(submitted == true) { return; }
document.forms["summary"].elements["summary__save"].click();
submitted = true;
return true;
}
and this works, the form doesnt get resubmit and the jsf action for
that button occurs onces, however I want to really gray out that
button. This seems simple, am i missing something?
multiple times. I can sovled this simply by saying the following:
onclick="this.disabled=true"
However the button does not peform a submit.
My jsf button def
<x
<h:commandButton action="#{activeForm.save}" id="save"
value="#{messages['detail_button_save']}" immediate="false"
styleClass="defaultButton" disabled="#{activeForm.noAppliedAmount}"
onclick="return submitDisable();" />
</x
I can do something like this
var submitted = false;
function submitDisable() {
if(submitted == true) { return; }
document.forms["summary"].elements["summary__save"].click();
submitted = true;
return true;
}
and this works, the form doesnt get resubmit and the jsf action for
that button occurs onces, however I want to really gray out that
button. This seems simple, am i missing something?