function simpan_create() {
$("#btn_create").prop('disabled', true);$('#form_modal').parsley().reset();$('#form_modal').parsley().validate();if ($('#form_modal').parsley().isValid()) {$.ajaxSetup({headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')}})$.ajax({url: "location/insert",type: "POST",data: $('#form_modal').serialize(),dataType: "json",success: function(response) {if (response.status == 200) {$("#modalForm").modal('hide');toastr["success"](response.message);locationTable.ajax.reload(null, false);if (response.stay == '1') {setTimeout(function() {show_create();}, 1000);}} else {alert('something wrong!!!');}$("#btn_create").prop('disabled', false);},statusCode: {422: function(data) {$.each(data.responseJSON.errors, function(key, value) {// Set errors on inputsif (key == 'location') {$('#err_room').html(value);$('#err_room').show();$("#btn_create").prop('disabled', false);//alert(value);// $('#input_kode_location').parsley().addError('customError', {// message: value// });}});$("#btn_create").prop('disabled', false);}}});} else {$("#btn_create").prop('disabled', false);}}
Tampilkan postingan dengan label jquery. Tampilkan semua postingan
Tampilkan postingan dengan label jquery. Tampilkan semua postingan
Minggu, 19 Februari 2023
Validasi Parsley Sebelum Submit
Jumat, 20 Januari 2017
Check All Checkbox Jquery
To check or uncheck all checkbox we can using this simple script
$('#cek_all').click(function (event) { //on clickGlad can share☺
if (this.checked) { // check select status
$('.checkboxs').each(function () { //loop through each checkbox
this.checked = true; //select all checkboxes with class "checkboxs"
});
} else {
$('.checkboxs').each(function () { //loop through each checkbox
this.checked = false; //deselect all checkboxes with class "checkboxs"
});
}
});
Langganan:
Postingan (Atom)