+ Start a Discussion
Ram ChaturvediRam Chaturvedi 

I want to skip a vf tag on the basis of a condition ?

<script type='text/javascript'> 
      var temp12 = 'false';
      if(temp12 == 'true'){
     
         <apex:inputField value="{!task.Chosen_object__c}" required="true" onchange="showObjects()" id="chooseObj"/> <br/>
      
       }
      else{
               <apex:outputField value="{!task.Chosen_object__c}" required="true" onchange="showObjects()" id="chooseObj"/>
      }
    </script>
SalesRedSalesRed
Hi, Can "temp12" be set as a value in the controller class or does it have to be a Javascript variable?  If you can add it to the Apex controll you can use the "rendered=" attribute to render the input or outputfield.

E.g.  <apex:inputField value="{!task.Chosen_object__c}" required="true" onchange="showObjects()" id="chooseObj" rendered="{!temp12}"/> <br/>

This will render if temp12 is true. It would need to be bound from the controller class though.
Prafull G.Prafull G.
Agreed with SalesRed. If this can be done using apex that would be great.
However, if can not, then you should go with javascript. Have this input field on the page and then based on the flag change the css to show'hide.

Cheers!