You need to sign in to do that
Don't have an account?
vijaysk
How to enable/disable attribute of Apex:commandButton using javascript in visualforce without controller
I have an apex:inputfield and Apex:commandbutton and i need to make the attribute"Disabled" of Apex:Commandbutton to true/false on click of apex:inputfield using javascript without using controller.Is it possible to do it ?If so please provide the sample code.
Use this javascript method in onclick. This will disable the command button.
function disableButton(){
document.getElementById("buttonId").className ="btnDisabled";
}
Thanks
Manoj S
Thanks for the reply.But Expected behavior is different like i have below:-
<apex:inputField value="{!ABC}" />
<apex:commandButton id="mybtnid" value="NEXT" disabled="true"/> // initially to true
Now, i need to make "disabled" of button "Next" to false when i click on inputfield text using javascript.Is it possible?
Note: i have taken the above function but i dont have class for "commandbutton" inorder to get the name of button.