+ Start a Discussion

How to hide and display a inputtext field on lookup value selection

Hi All,

0down votefavorite

I have a vf page where I have a lookup field as Account.MyThunder__Account__c
and a inputtext field Account.MyThunder__Business_Hours__c.

I want if i select user as 'X' then text field should appear else remain hidden.

How can we achieve this scenario.
<apex:page standardController="Account" >
<apex:form >
<apex:pageBlock id="xxxpb1">


<apex:actionRegion >               

  <apex:inputField id="xxxif1" value="{!Account.MyThunder__Account__c}" required="true" >

     <apex:actionSupport event="onchange" rerender="xxxpb1" />



<apex:pageBlockSection id="xxxpbs1" rendered="true">

 <apex:inputField id="xxxif2" value="{!Account.MyThunder__Business_Hours__c }" rendered="{!IF(Account.MyThunder__Account__r.Name =='United Oil & Gas Corp.',true,false)}"/>