If you are going to use document.getElementById to access a vf component, you should use $Component to get the appropriate generted id, instead of hard-coding the generated id. That way it won't break every time you make a change to the page or salesforce makes a change to the generated html.
got the answer in the tag
<apex:inputcheckbox style="visibility:hidden" />
All Answers
got the answer in the tag
<apex:inputcheckbox style="visibility:hidden" />
yeah we can do it in another way too.
<apex:inputCheckbox id="chk" value ="checkbox"/>
<script>
document.getElementById(page:form:section:chk).visibility = false;
</script>
If you are going to use document.getElementById to access a vf component, you should use $Component to get the appropriate generted id, instead of hard-coding the generated id. That way it won't break every time you make a change to the page or salesforce makes a change to the generated html.
Somethng like:
<apex:inputCheckbox id="chk" value ="checkbox"/>
<script>
document.getElementById({!$component.chk}).visibility = false;
</script>
Using the style=hidden helped me with checking a hidden checkbox on save of a custom form. Thanks very much for this post.