Browse Source

Trigger HTML5 form validation on CRUD edit

master
Riyyi 4 years ago
parent
commit
541b1de8de
  1. 8
      public/js/app.js

8
public/js/app.js

@ -25,8 +25,14 @@ $(document).ready(function() {
// Edit // Edit
$('.js-edit').on('click', function(event) { $('.js-edit').on('click', function(event) {
var href = $(this).attr('href');
// Trigger HTML5 form validation
var valid = $('#form-edit')[0].reportValidity();
if (!valid) {
return;
}
var href = $(this).attr('href');
$.ajax({ $.ajax({
url: href, url: href,
type: "PUT", type: "PUT",

Loading…
Cancel
Save