I have created a select list and an input field. The input field is required based on the select list value "New". The following code is not working for me. Please let me know what am I doing wrong here:
<apex:pageBlockSectionItem >
<apex:outputLabel value="Request Reason" />
<apex:outputPanel styleClass="requiredInput" layout="block" id="pwPanel" >
<apex:outputPanel styleClass="requiredBlock"/>
<apex:selectList size="1" value="{!sreason}" label="Request Reason" required="true" style="width: 155px; " >
<apex:selectOptions value="{!sreasons}" />
</apex:selectList>
</apex:outputPanel>
</apex:pageBlockSectionItem>
<apex:inputField value="{!Scases.Vendor_Number__c}" required="{!if(sreason== 'New',true,false }"/>