Clear value on reference field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2020 01:36 AM
Hello All,
I have reference field by name field1 and 2 other fields by name field2 and field3. The values on field2, field3 are based on the reference field1. what I'm trying to achieve is if I have a value on field1 as xxxx, it sets field2, field3. later when I try to edit value on reference field1 to something else, i want the fields2, field3 to show no data on it (while i'm trying to change value on field1)
Field1 = reference field
Field2, Field 3 = text field
Any help?
Sowmya
- Labels:
-
Scripting and Coding
-
Team Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2020 01:42 AM
Hi,
You probably have a script on change of field 1 that adds data on field 2 AND 3
On that script the first check would be
if(isLoading || newValue=='')
return;
You have to modify this part to
if(newValue=='')
{
g_form.clearValue('<field 2>');
g_form.clearValue('<field 3>');
}
if(isLoading)
return;
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2020 02:40 AM
Hello Anurag,
This is what I already have in place. the problem is I have selected a value on vendor field and now based on my onchange script, data has been populated on my below 2fields. However if i start editing the reference field or just remove the data on reference field and do not make any click on the form, the data would still be there with the below 2 fields. So as soon as user try to edit the reference field or type looking for new field, data should be cleared on below fields. Hope you are getting me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2020 02:47 AM
That is just how on change works...When you type something and move the focus out of the form that is when on change triggers, there is nothing you can do to change this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2020 02:51 AM
Thanks for the input.. now i'm clear, there is no other way.