Here is simple code With javascript.
<apex:page >
<head>
</head>
<apex:form >
<script>
function HideMsg(istrue)
{
var checkval = document.getElementById("msg")
if(istrue.checked )
{
var checkval = document.getElementById("msg").style.display='block';
}
else
{
var checkval = document.getElementById("msg").style.display='none';
}
}
</script>
<apex:pagemessages />
<div>
<apex:inputCheckbox id="checkbox" onchange="HideMsg(this);"/>
</div>
<div class="showp" style="display: none" id="msg">
<p>Hello World</p>
</div>
</apex:form>
</apex:page>
JavaScript
,
Visualforce
<apex:page >
<head>
</head>
<apex:form >
<script>
function HideMsg(istrue)
{
var checkval = document.getElementById("msg")
if(istrue.checked )
{
var checkval = document.getElementById("msg").style.display='block';
}
else
{
var checkval = document.getElementById("msg").style.display='none';
}
}
</script>
<apex:pagemessages />
<div>
<apex:inputCheckbox id="checkbox" onchange="HideMsg(this);"/>
</div>
<div class="showp" style="display: none" id="msg">
<p>Hello World</p>
</div>
</apex:form>
</apex:page>
No comments:
Post a Comment