g_form. clearMessages is not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2021 03:04 PM
g_form. clearMessages is not working in onSubmit script for a catalog form. I am trying to clear out old messages when user fills in fields and clicks submit. it seems like the old message are not going away. Below is the test script.
function onSubmit() {
g_form.clearMessages();
//Type appropriate comment here, and begin script below
g_form.showErrorBox("field1","Test");
return false;
}
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2022 05:51 AM
As previously stated, g_form.clearMessages() only works for the form message banners at the top of the record.
With you using field messages, you need to be using:
g_form.hideFieldMsg("<your field here>");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2025 06:50 AM
Hello Aman,
I know its too late to reply, but thought of sharing the information that I really tried in my PDI and the result of the
g_form.clearMessages() - is used to clear any info or error messages added on the top of form, it won't removes any field level messages. Kindly try from your end as well.
Thanks
Anil Annavarapu