Question: I have a question on how to use render on command button?

```
<apex:pageBlockButtons >
    <apex:commandButton onclick="appendSelected(); return false;" value="Select" />
    <apex:commandButton onclick="appendSelected1(); return false;" value="Select"/>

</apex:pageBlockButtons>

```

I want to restrict `appendselectedfunction()` on `appendselected1()`!

Answer: 
**Putting an inside your tags and using that as the rerender target makes the page work as expected:** 

First of all you need to remove the renderRegionOnly attribute on your actionRegion component -- that is not doing what you think it's doing. Simply surrounding your inputField with an actionRegion will submit only that inputField without submitting the values outside of it (as you've alluded to in your HTML comment).

Whatever you want to be conditionally rendered should have rendered="{!Opportunity.StageName != 'Qualification'}" because that is the expression that will be evaluated whenever that component is created or updated.

And then finally, the target of what you are rerendering needs to always be on your page -- in more basic terms, whatever id you specify in rerender="someId" cannot be on the same component that has the rendered="{!Opportunity.StageName != 'Qualification'}" on it. So if you want your outputPanel conditionally rendered, it can't be the target of your rerender attribute. You may need to put it inside of another outputPanel. For more explanation see this <https://developer.salesforce.com/forums?id=906F000000094hvIAA>

```
<apex:pageBlockButtons location="bottom" id="d">
<apex:outputPanel id="buttons">
       <apex:commandButton onclick="appendSelected(); return false;" value="Select" rendered="{!selectId=='show'}"/>
       <apex:commandButton onclick="appendSelected1(); return false;" value="Select" rendered="{!selectId=='show'}"/>        
</apex:outputPanel>
</apex:pageBlockButtons>

```
[apex:commandButton](https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_commandButton.htm) rendered attribute takes a boolean condition and based on the boolean condition value the button will get rendered in UI. 

In your case lets say you have a controller variable status and you only want to show the button if status = 'pending' then.

```
 <apex:commandButton onclick="appendSelected(); return false;" value="Select" 
 rendered="{!testResultObj=='Pending'}"/>

```

1. If testResultObj is pending, the condition evaluates to true and the
button will get displayed in UI
2. If testResultObj is not pending then the condition will evaluate
to false and the button will not be visible.