I have a Pageblock where I am listing all contacts of an Account and I got a picklist status - Active & Inactive.

After picklist values are changed, we can save the list of records but there is no page redirect.

We got another action being done in another button which would disable the save button. And if a user once again changes the picklist values we should enable the Save button which is in the same Pageblock.

<apex:commandbutton action="{!Save method}" disable="{!booleanforsave}"/>
<apex:inputfield value="{!picklistfield}"> 

There is no rerender attribute in inputfield so I am using actionsupport

<apex: actionsupport event="Onchange" rerender="form" action="{!enablesavebutton}"/>

But none of them are working. Please help me out

  • Please align the code, It wouldn't be visible until you do so. Commented Dec 2, 2016 at 10:51
  • The On change should be one word event="onchange". Check if this is a issue.
    – Saroj Bera
    Commented Dec 2, 2016 at 11:16
  • Yes, I wrote it as single word. It's a typo here
    – SFDev
    Commented Dec 5, 2016 at 7:27

1 Answer 1


IF you want to call a method on change of a field in a list, then I would suggest go for a javascript event handlers. Else there will be many calls to your controller every time there is a change of that field in that list.

As per your code:

<apex:inputfield value="{!picklistfield}"> 
<apex: actionsupport event="On change" rerender="form" action="{!enablesavebutton}"/>

Change it to

<apex:inputfield value="{!picklistfield}" oncomplete="DisableSaveButton(passyourbuttonid);"/> 

    function DisableButton(button) {
        button.disabled = 'true';
        button.className = 'btnDisabled';

Reference: http://resource-centre.net/free-javascript-tutorials/event-handlers-javascript/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .