You need to sign in to do that
Don't have an account?
srikanth cheera 13
visuforce 100
I have 2 pageblocks
firstone should be apper on the screen sencond should be hide mode.
after filling the data in first pageblock hide the first one and second sholud be apper.
please help me.
firstone should be apper on the screen sencond should be hide mode.
after filling the data in first pageblock hide the first one and second sholud be apper.
please help me.
I got your query.Please do follow the code below:
Vf page:
<apex:page controller="ShowHideController" showHeader="false" id="pg">
<apex:form >
<script>
function hideme(value)
{
var ca=value;
console.log('>>>>'+ca);
if(ca==''){
}
else
{
actionfun();
}
}
</script>
<apex:actionFunction name="actionfun" action="{!hide}"/>
<apex:pageBlock title="Block 1" rendered="{!hideblock}" id="pb" >
Data for Block 1 <apex:inputText onclick="hideme(this.value);" label="data one" />
</apex:pageBlock>
<apex:pageBlock title="Block 2" rendered="{!hidesecblock}">
Data for Block 2 <apex:inputText label="data two" />
<apex:inputText label="" />
</apex:pageBlock>
</apex:form>
</apex:page>
Controller Class:
public class ShowHideController {
public Boolean hideblock{get;set;}
public Boolean hidesecblock{get;set;}
public ShowHideController()
{
hideblock=true;
hidesecblock=false;
}
public void hide()
{
System.debug('java script');
hideblock=false;
hidesecblock=true;
}
}
Hope this code will help you. Please mark it as best answer if you find it helpful.
Thanks.
Ajay Dubedi