You need to sign in to do that
Don't have an account?
d.tejdeep@nicomatic.in
Making field required based on user input on other input field ?
<td><apex:inputField value="{!child.batchObj.Asked_Qty__c}"/></td> <td><apex:inputfield value="{!child.batchObj.Quantity__c}" required="{!child.batchObj.Asked_Qty__c=0}" style="width:110px"/></td>
When inputfield "Asked_Qty__c" was empty .then "Quantity__c" was not required .
When inputfield "Asked_Qty__c" was not empty .then "Quantity__c" was required
I want to do this asked quantity was entered by salesforce user ?
Based on input it should take required or not require ?
How can i do this Thanks in Advance ?
Try this
<td>
<apex:inputField value="{!child.batchObj.Asked_Qty__c}">
<apex:actionSupport event="onChange" rerender="blck"/>
</apex:inputField>
</td>
<td><apex:inputfield value="{!child.batchObj.Quantity__c}" required="{!IF(child.batchObj.Asked_Qty__c!=null,TRUE,FALSE)}" style="width:110px"/></td>
If you are using page block in the page then peovide id for that pageblock as blck, and remeber form tag should be used.
Reagrds,
N. Vinay Kumar.
Thanks for your answer
This is not working i tried before also the same
Please let us know if this will help you
Thanks
Amit Chaudhary
Check the below sample code
Sample Apex controller
Bro try with above code and let me know if it is working or not.
If this solve you problem mark this as best answer to help others.