Show Field Message - Auto hides after a field is edited
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2018 07:55 AM
Hi All,
We recently upgraded from Jakarta to Kingston and while testing we noticed that whenever a field on a catalog item is edited, if there is a was a field message shown on it (via g_form.showFieldMsg), the field message is automatically removed. In Jakarta it didn't do this, it left the field message there until a g_form.hideFieldMsg or g_form.hideAllFieldMsgs was invoked on it.
Is there a property that controls this functionality? or this the new way field messages work?
Thanks in advance!
-Josh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2018 08:59 PM
Hi Josh,
When you use on Load client script for field message, as soon as you load the form the message will display under the field but when you enter some value in the field the message goes off.
If you want to display the field message even though if you enter the value, Write one more onchange client script with the same message. so that script will trigger and show you the field message even if field changes are made.
//tested
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
g_form.showFieldMsg('fieldname','message');
}
Please Hit Helpful /Correct answer depending on the impact of the response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-14-2018 05:52 AM
Hi Abhishek,
Thanks for the quick response, I already updated some of my scripts similar to how you described but I was hoping that their was a property I could have just changed instead. We have around 100+ scripts that do this and when we updated to Kingston, the way the field message works changed.
Thanks,
Joshua Anderson