I would like to change the default sentence "The form could not be submitted because X errors were found." to something else. Is that even possible?
Thank you,
Maybe so. You should follow https://github.com/wet-boew/wet-boew/issues/8803.
Edit: Using the discussion in #8803 and the lang-code column from https://github.com/wet-boew/wet-boew/blob/master/src/i18n/i18n.csv, I think that these are the two fields you want to try to overwrite:
wb.i18nDict["frm-nosubmit"]wb.i18nDict["errs-fnd"]HEY, I need your help. I update the change as suggested. it shows the customized error message on IE, HOWEVER. NOT in chrome and edge. why?
@RobJohnston
Could you post some code @mingjiongliao, to show what works in IE but not elsewhere?
basically I just copy the code posted here:
$(".wb-frmvld").one("timerpoke.wb", function (event) {
if (document.getElementsByTagName("html")[0].getAttribute("lang") !== "en")
return;
wb.i18nDict["frm-nosubmit"] = "Please correct ";
wb.i18nDict["errs-fnd"] = " errors on this page.";
wb.i18nDict["err-fnd"] = " error on this page.";
});
$(".wb-frmvld").one("timerpoke.wb", function (event) {
if (document.getElementsByTagName("html")[0].getAttribute("lang") !== "fr")
return;
wb.i18nDict["frm-nosubmit"] = "Veuillez corriger ";
wb.i18nDict["errs-fnd"] = " erreurs sur cette page.";
wb.i18nDict["err-fnd"] = " erreur sur cette page.";
});
it works in local and when I deploy to server, I can see the customized error message in IE, but not in Chrome and Edge.
It all looks good to me... don't know why it would work in one browser but not others. I put together a fiddle in case anybody else wants to see this working*: https://jsfiddle.net/wh4a5q3x/
*And because I think we should use more fiddles!
Most helpful comment
Maybe so. You should follow https://github.com/wet-boew/wet-boew/issues/8803.
Edit: Using the discussion in #8803 and the
lang-codecolumn from https://github.com/wet-boew/wet-boew/blob/master/src/i18n/i18n.csv, I think that these are the two fields you want to try to overwrite:wb.i18nDict["frm-nosubmit"]wb.i18nDict["errs-fnd"]