Hi.
I want to submit the form when I change the state of two different checkboxes. It seems to be submitting fine, but does not update the user.
Don't mind the "beautiful" split to get your onsubmit code :)
$('#check1, #check2').on('change', function () {
var form = $(this).closest('form');
var splitFormH = $(form).attr('onsubmit').split("['FormCH1_h'].value='");
var FormH = splitFormH[1].split("';e.elements['_sys_to_email']");
var splittedUrl = $(form).attr('onsubmit').split("'action', '");
var Url = splittedUrl[1].split("');return");
$('input[name="FormCH1_h"').val(FormH[0])
$('.js-labels-form').attr('action', Url[0]);
$('input[name="_sys_to_email"]').val('');
$.ajax({
type: form.attr('method'),
url: form.attr('action'),
data: form.serialize(),
success: function (data) {},
error: function (data) {},
});
});