show field message always
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2018 12:25 AM
Hi All,
I am displaying few project code formats based on country.
I wrote on change client script on country field.
if(country == 'xx'){
g_form.showFieldMsg('project_code','AAxx-xx-ZA')', 'info');
if(Country =='yy')
g_form.showFieldMsg('project_code','AAxx-xx-ZAyt-xx')', 'info');
I am also showing a pop up once the user clicks submit if format is not matching. But as soon as I click ok on pop up and come back to the field, i see that the field message is not displayed.
I need to change the MF to see the field message again. Is there any way I can retain field messages?
Many Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2018 12:30 AM
You should have a onload client script to make that work , else remove below script in your onchange script ,so that it works on load as well
if (isLoading )
return;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2018 12:32 AM
Hi
Please can you try with this once?
I'm not sure if this will work but give it a try.
if(country == 'xx')
{
g_form.showFieldMsg('project_code','AAxx-xx-ZA')', 'info');
return false;
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2018 12:40 AM
The syntax you used for showFieldMsg is incorrect . Could you please use
g_form.showFieldMsg("fieldName","message",'info(or)error");
Use switch and display different field messages for different fields and then in onchange script itself validate if the format you expected is what user entered else throw an error message and clear the value user selected
That may resolve your issue.
Thanks,
Siva
Mark this answer as correct if that really helps 🙂