function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Disable both top and bottom "pageBlockButtons" using JavaScript

I found a problem with disabling both top and bottom "pageBlockButtons"  in a VF page. When I am using JavaScript to disable the buttons only top pageBlockButtons are disabled.

Here is my JavaScript


this.btnMailSubmit.disabled = true;  

this.btnMailSubmit.className = 'btnDisabled'; 


and the VF code for  pageBlockButtons



<apex:pageBlockButtons id="submitButtons" > ............. <apex:commandButton id="btnMailSubmit" value="Help Me" action="{!send}" onClick="return onDataFormSubmit();" /> </apex:pageBlockButtons>


 Can you help me on this?



Message Edited by Chamiz on 10-06-2009 09:56 PM
Best Answer chosen by Admin (Salesforce Developers) 

I found the solution for this


function btnDisable(){ var theForm = window.document.forms[FormName]; for(i=0; i < theForm.elements.length; i++){ if (theForm.elements[i].type == "submit"){ if (theForm.elements[i].disabled == false) { theForm.elements[i].disabled = true; theForm.elements[i].className = 'btnDisabled'; } } } }


Message Edited by Chamiz on 10-07-2009 01:43 AM