Create a boolean property in your controller and assgin "true" initially.
public boolean showField{get;set;}
Bind this to the rendered attribute of the custom field rendered="{!showField}"
Onclick of the button, call a function in controller to make the showField property to false; and keep the rerender attribute of the button equal to your Customfield Id.
<script>
function hidefield()
{
document.getElementById("fieldIDtobehide").style.dispaly = "none";
return false;
}
</script>
<apex:commandbutton onclick="return hidefield();"/>
<input type="text" id ="fieldIDtobehide" />
All Answers
Create a boolean property in your controller and assgin "true" initially.
public boolean showField{get;set;}
Bind this to the rendered attribute of the custom field rendered="{!showField}"
Onclick of the button, call a function in controller to make the showField property to false; and keep the rerender attribute of the button equal to your Customfield Id.
<script>
function hidefield()
{
document.getElementById("fieldIDtobehide").style.dispaly = "none";
return false;
}
</script>
<apex:commandbutton onclick="return hidefield();"/>
<input type="text" id ="fieldIDtobehide" />