Validation Script When Drop Down value = something set another field to be required
Copy link to clipboard
Copied
I have a drop-down filed titled Initial Contact Type and another titled UCR Offense1
If the value selected in the initial contact type field is Response to unlawful or suspicious activity I want the UCR Offense1 field to be required else leave it not required
I put the following code in the Run custom validation script section of the UCR Offense1 field.
It does not work it will change the UCR Offense1 field to required no mater what is in the field.
Any Thoughts
var v = this.getField("Initial Contact Type").value;
if(v = "Response to Unlawful or Suspicious Activity"){
event.target.required = true;
}
else {
event.target.required = false;
}
Copy link to clipboard
Copied
Hi,
You must write:
if(v == "Response to Unlawful or Suspicious Activity")
and place the script in "calcul" of the field if you wish keep "event.target.required".
Else you place the script in mouse up of the drop-down field, but you will have to use "this.getField("UCR Offense1").required"= true/false. You need to tick "Commit on selection change" (I don't know the exact name in English).
@+

