Skip to main content
noor8380
Participant
November 23, 2022
Answered

Reset a field upon a change in the dropdown

  • November 23, 2022
  • 2 replies
  • 1003 views

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?

This topic has been closed for replies.
Correct answer noor8380

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");}

2 replies

try67
Community Expert
Community Expert
November 23, 2022

As the custom validation script of "f1" enter the following:

this.resetForm(["f2"]);

noor8380
noor8380AuthorCorrect answer
Participant
December 4, 2022

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");}

Nesa Nurani
Community Expert
Community Expert
November 23, 2022

It should reset to what? Can you describe the process exactly how it should work?

noor8380
noor8380Author
Participant
December 4, 2022

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");