دنبال کننده ها

۱۳۹۶ مرداد ۱۰, سه‌شنبه

javascript - Disable button onclick after user clicks it once

[ad_1]



I have two files..one .jspx and other .js page.
Code of .jspx file:



<form name="vacNotificationEdit" method="post" >
<input type="button" class="button_medium" name="Save As Draft" id="Save" value="Save As Draft" onclick="javascript:vacFunction('save');" ><![CDATA[&nbsp; ]]></input>
<input type="submit" class="button_big" name="Submit for Review" id="Submit" value="Submit for Review" onclick="javascript:vacFunction('submit');" ></input>
</DIV></TD>


code of .js page:



function vacFunction(strAction)
{
if(deptMgrId!="")
document.vacNotificationEdit.hidAction.value = strAction;
document.vacNotificationEdit.action ="vacationNotification";
document.vacNotificationEdit.submit();



I need to disable the submit button after it is clicked once.Please help me through this.I am stuck.I have used disabled=true/false but no luck .




[ad_2]

لینک منبع