Copy link to clipboard
Copied
I have a dropdown field named f1
And a date field named f2
f2 needs to reset onchange of f1 to any of option values.
Any pointers?
Copy link to clipboard
Copied
I figured out the answer by reading the documentation:
In the validation script of f1, the following script did the job.
if (event.rc) {this.resetForm("f2");}
Copy link to clipboard
Copied
It should reset to what? Can you describe the process exactly how it should work?
Copy link to clipboard
Copied
It can reset to empty.
Let me explain a scenario.
The dropdown field f1 has a selected value (lets say "Option 1") and the date field f2 has a date value in it.
Now, if we change the dropdown value to Option 1 or Option 2 or any dropdown option, by a mouse event, or a keyboard event, f2 should reset to null like this.resetForm("f2");
Copy link to clipboard
Copied
As the custom validation script of "f1" enter the following:
this.resetForm(["f2"]);
Copy link to clipboard
Copied
I figured out the answer by reading the documentation:
In the validation script of f1, the following script did the job.
if (event.rc) {this.resetForm("f2");}