Need help mapping form fields
We are using ReachForce with our forms. It identifies company industries based on company names. If a user inputs a company name that is not on the "Industry" picklist, the "Industry_M__c" picklist is displayed. I want that value mapped to the "Industry" field. I am using the code below. It works, but only some of the time. I am completely flummoxed as to what I am doing wrong. Any thoughts?
<script type="text/javascript">
MktoForms2.whenReady(function(form) {
//listen for the validate event
form.onValidate(function() {
// Get the values
var vals = form.vals();
//Check your condition
if (vals.Industry_M__c !== "") {
(vals.Industry = vals.Industry_M__c);
}
});
});
</script>
Thanks in advance for any help!