Overriding handleValidationMessage locally instead of globally

Hello,

Is there a way to modify form with data-request handler handleValidationMessage locally? There is no data-attribute api shortcut.

Something like document.getElementById('form').addHandlerForAjaxRequest(...) or whatever…

Hi,

Try this oc.request('form', { handleValidationMessage: function() { }, ... })

Or, to be exact to your example:

document.getElementById('form').addEventListener('ajax:setup', function(event) {
    const { options } = event.detail.context;
    options.handleValidationMessage = function() { };
});