show field message always

MMKK
Tera Expert

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

 

3 REPLIES 3

VigneshMC
Mega Sage

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;

Omkar Mone
Mega Sage

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;

}

siva_
Giga Guru

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 🙂