I'm creating a New Hire Set Up form which includes a drop down field, Employment Type, with 3 choices: Team Member; Strategic Partner; and Affinity Partner. There's also a Pay Type drop down field, also with 3 choices: Commission; Hourly; and Salary. I'm trying to create a script that will change the Pay Type field to Commission and disable the field (so it can't be changed to Hourly or Salary) if the Employment Type field is not Team Member.
I've added EmploymentType and PayType class to the respective fields and created the script below. As you can see below, when the Employment Type field is not Team Member, the script is not changing the Pay Type to Commission and it allows any of the Pay Type choices to be selected.
I'm still going through the learning phase of using jscript, so I'm sure there's something I'm still missing.
As always, any help is greatly appreciated!