2

Sorry for the noob question, haven't used visualforce much. I couldn't find an example for this for a picklist field only checkbox but how do I only return the confirm dialogue for a specific value in the picklist being slected eg. 'Approved'.

<apex:page standardController="Funds_to_Trade__c">
<apex:form >
     <apex:inputField value="{!Funds_to_Trade__c.Adviser_Approval__c}" 
    onchange="if(!confirm('PLEASE NOTE: By approving this you acknowledge that you have thoroughly checked over the record.')){return}"/>
</apex:form>

1 Answer 1

1

Try this ;)

 onchange="if(this.value == 'Approved'){
  if(confirm('PLEASE NOTE: By approving this you acknowledge that you have thoroughly checked over the record.')){
    /* user selected ok button */
  }else{
    /* User selected cancel button */
    return;
  }
}"
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .