Error Box: Custom
The error box (optional) can be styled with CSS or you can make a custom one.
To make a custom error box that will display all of your error messages, add HTML as follows:
<div id="custom-error-box" style="color: red;">
<ul></ul>
</div>
Remove the selector
#splitit-error-box
from your JavaScript if you have it (you don't need a selector).Next add CSS to disable the default error behavior:
.splitit-flex-field-error {
display:none !important;
}
Finally, add code to assemble the error box (make sure to include the jQuery library to use this):
<script>
}).onError(function (err) {
console.log(err)
$("#custom-error-box").children().remove();
$(err.errors).each((idx, el) => {
if (el.showError) {
$("#custom-error-box").append(`<li>[${el.code || 'client'}], Error: ${el.description}</li>`);
}
});
})
</script>
Last modified 7mo ago