I am trying to write a simple script that will populate a text field based on another drop down field's selection. I'm getting an error but I have copied the code from somewhere and tried to make it my own with little luck. Please advise? I am adding this as a calculation script.
var selectedContact person = this.getField("Contact person").value; if (selectedContact person=="Person A") event.value = "+ 44 123 456 7890"; else if (selectedContact person=="Person B") event.value = "+ 44 123 456 7890"; else event.value = "";
I'd like to repeat the code on a "Contact Email" field where based on the selection in "Contact person" the email address is prefilled.
Any help is much appreciated.
You can't use spaces in the name of a variable in JS.