- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2016 10:40 PM
Hi,
I have written a client script which populates value of a readonly field based on value selected in another reference field on the form.
when I select a value in reference field , it is populating value..
What I need here is when I remove the value from that reference field , the value populated in readonly field should also get removed.
I have written a OnChange script on reference field.
Please help.....
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2016 11:11 PM
Hi avani,
there is this line on the top.
if (isLoading || newValue == '') {
return;
}
u need to change it to
if (isLoading) {
return;
}
and add below code.
if (newValue == '') {
g_form.setValue('fieldname', '');
return;
}
I hope this helps.
please mark helpful/correct based on impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2016 10:58 PM
Hi avani,
add something like this on your on change script:
if (newValue == '') {
g_form.setValue('fieldname', '');
return;
}
Thanks,
Kushagra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2016 11:05 PM
Hi Kushagra,
It is not working, I guess OnChange script is not able to detect when I am deleting the value of the field.
As it might not considered a change in value..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2016 11:06 PM
can you paste your code here ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2016 11:11 PM
Hi avani,
there is this line on the top.
if (isLoading || newValue == '') {
return;
}
u need to change it to
if (isLoading) {
return;
}
and add below code.
if (newValue == '') {
g_form.setValue('fieldname', '');
return;
}
I hope this helps.
please mark helpful/correct based on impact.