1

I have 3 fields on visualforce page of custom object,

 1) gender__c:Male/female(picklist field)
 2) age__c: (number field)
 3) field3__c:(picklist field)

The field3__c only display, If the gender__c=female & age__c>12.

code:

Visual force page:

<apex:actionRegion>
    <apex:inputField value="{!obj.Age__c}"/>

    <apex:inputField value="{!obj.Gender__c }">
        <apex:actionSupport event="onchange" rerender="Pbs" />
    </apex:inputField>
</apex:actionRegion>

<apex:pageBlockSection id="pbs" rendered="true">   
    <apex:inputField id="field3" value="{!obeject.field3__c}" rendered="{IF(object__c.Gender__c="Female" & object__c.Age__c >12 ,true,false)}"/>    
</apex:pageBlockSection>

error:

Element type "apex:inputField" must be followed by either attribute specifications, ">" or "/>".

  • are you aware of rendered and rerender attributes? – Mr.Frodo Jun 7 '17 at 6:06
  • can you please post Vf code related to the fields – night crawler Jun 7 '17 at 6:22
  • I have an idea on rendered and rerender, But here we are displaying the field3__c based on the 2 different field values. – Ravindar Admin Jun 7 '17 at 6:23
  • @Sarath Garimella, I edited question with vf code. Hope expecting answer. Thank you. – Ravindar Admin Jun 7 '17 at 6:34
  • @RavindarAdmin whatever code you posted is not helpful. visual force page section is blank and apex class section is also not useful – night crawler Jun 7 '17 at 6:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.