Copy link to clipboard
Copied
Can someone teach me what is wrong with this script? It says there's an unterminated string literal on line 3. When a user enters a contract number in Field1, I want the form to populate the name of the company the contract is tied to in the field this script is in.
var f = this.getField("Field1")
if(event.value == "Contract Number”)
f.value = "Company Name";
else
{
// do nothing
}
Copy link to clipboard
Copied
Use this:
var f = this.getField("Field1")
if (event.value == "Contract Number1") {
f.value = "Company Name1";
} else if (event.value == "Contract Number2") {
f.value = "Company Name2";
} else {
// do nothing
}
Copy link to clipboard
Copied
Perfect! Thank you for your help! I just wish I knew what was wrong with my copy.