How to change the template for (error) messages with userforms?

<%- if @topic_view.topic.tags.present? %>
<%= t 'js.tagging.tags' %>: <%- @topic_view.topic.tags.each do |t| %> <%= t %> <%- end %>
<% end %>

Silverstripe Version:

I want to add extra classes to the error messages of userforms. How to do this?

<span id="UserForm_Form_34_EditableTextField_60d74-error" class="error message">This field is required</span>

I’d also like to know this… did you make any progress with this?

Update: this seems to be controlled from within the .js file

specifically the section:

UserForm.prototype.validationOptions = {
    ignore: ':hidden,ul',
    errorClass: 'error',
    errorElement: 'span',
    errorPlacement: (error, element) => {

      if (':radio') || element.parents('.checkboxset').length > 0) {
        error.appendTo(element.closest('.middleColumn, .field'));
      } else if (element.parents('.checkbox').length > 0) {
      } else {

I’m just not sure (yet) how to hook into this from eg. a custom .js file to modify/extend this. I’m not that familiar with jQuery, so if anyone knows how to do this, that’d be great!

I guess some more documentation in UserForms on how to style the module’s default jQuery validate features would be great!