Skip to content

Commit

Permalink
Fix jquery validator plugion not work with submit form on safari
Browse files Browse the repository at this point in the history
  • Loading branch information
phuonghuynh committed May 15, 2020
1 parent 7ac7b98 commit caffd06
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,17 @@ <h3 th:unless="${isCollapsible}" class="panel-title" th:text="#{header.proposalD
$('button').each(function() {
$(this).attr('disabled', 'disabled');
});


var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
if (isSafari) {
var submitButtonName = $(this.submitButton).attr("name");
$('<input>').attr({ //fix for Safari
type: 'hidden',
id: submitButtonName,
name: submitButtonName
}).appendTo(form);
}

form.submit();
return false;
},
Expand Down

0 comments on commit caffd06

Please sign in to comment.