- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2020 07:50 PM
Hi Guys,
I have a OnSubmit Client Scripts as below, tried to add in "g_form.clearMessages();" in order to clear the precious error messages, but it still leaving the first error on top and unable to clear it. (If I remove the "g_form.clearMessages();" , the error will keep stacking up when the user press the Submit button for second / third time etc.
Any suggestion on the ways to clear All the Error PopUp previously then only show the new Error Message (if any) ??
===================================================================
function onSubmit() {
if(g_form.getValue("Variable_1") == "Yes") {
g_form.clearMessages();
g_form.addErrorMessage("Not suitable for storing Government or Banking data.");
return false;
}
if(g_form.getValue("Variable_2") == "Yes") {
g_form.clearMessages();
g_form.addErrorMessage("Not suitable for storing Highly Confidential Data.");
return false;
}
if(g_form.getValue("Variable_3") == "Yes") {
g_form.clearMessages();
g_form.addErrorMessage("Not suitable for storing Personal Data (Beyond Business card details).");
return false;
}
}
=======================================================================
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2020 04:50 PM
Hi Guys,
thanks for trying to help, I have solved this myself by using the OnChange function:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//When "will you be storing Government Data" selected with "No", it will clear the message
if (isLoading || newValue == 'No') {
g_form.clearMessages();
return;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2020 04:50 PM
Hi Guys,
thanks for trying to help, I have solved this myself by using the OnChange function:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//When "will you be storing Government Data" selected with "No", it will clear the message
if (isLoading || newValue == 'No') {
g_form.clearMessages();
return;
}
}