I have a Drupal 8 form with checkboxes. The form submits upon clicking on a checkbox using JQuery.
Here is my code.
$('#edit-event-types input[type=checkbox]').on('change', function(event, ui){
$('#events-to-doc').submit();
})
Unfortunately, if there isn't any submit button in the form, then function submitForm in the form class doesn't execute. But I don't need in a submit button on the form, I want to submit the form clicking on the checkboxes.
Can I somehow set the checkboxes element as the triggering element with Jquery? I need the function submitForm to execute and $form_state->getTriggeringElement() return the checkboxes as the triggering element.