You need to sign in to do that
Don't have an account?
Chinnodu
Text filed is required Based on select value from pick list
HI Dudes,
I want required on text box ased on picklist value. i having text field is :"Office_Phone__c" and picklist value "Department__c".When evar i can set as Department__c==Department__c"" for that time i want rerquird "Office_Phone__c" filed.
Pls help mr for below code.
sai
I want required on text box ased on picklist value. i having text field is :"Office_Phone__c" and picklist value "Department__c".When evar i can set as Department__c==Department__c"" for that time i want rerquird "Office_Phone__c" filed.
Pls help mr for below code.
<apex:page controller="employmenthistiry" sidebar="true"> <apex:form > <apex:pageBlock id="pgBlckId"> <apex:pageBlockSection title="Employe" collapsible="false"> <apex:inputField value="{! emp.Report__c}"/> <apex:inputField value="{! emp.Name }"/> <apex:inputField value="{! emp.Date_of_joining__c}"/> <apex:inputField value="{! emp.Department__c}"/> <apex:inputField value="{! emp.Desigination__c}"/> <apex:inputField value="{! emp.Email__c}" required="true"/> <apex:inputField value="{! emp.Employeeid__c}"/> <apex:inputField value="{! emp.Mobile__c }"/> <apex:inputField value="{! emp.Office_Phone__c}" required="!IF(emp.Department__c=='IT',true,false)}" id="Office_phonerequired"/> <apex:inputField value="{! emp.payslip_lase_sent_date__c}"/> <apex:inputField value="{! emp.Technology__c}"/> </apex:pageBlockSection> </apex:pageblock> </apex:form> </apex:page>Regards,
sai
You can do this by calling one javascript function onchange of department field. in that function you can set it is required or not.
Here is the code:
please Like this answer if you find it helpfull
thanx,
Atul Patil
www.zen4orce.com