parsley validation

23:08 Unknown 0 Comments

 $('#corrective-form .btn').on('click', function() {
           $('#corrective-form').parsley().validate();
           validateFront();
         });
         var validateFront = function() {
           if (true === $('#corrective-form').parsley().isValid()) {
             $('.bs-callout-info').removeClass('hidden');
             $('.bs-callout-warning').addClass('hidden');
           } else {
             $('.bs-callout-info').addClass('hidden');
             $('.bs-callout-warning').removeClass('hidden');
           }
         };

0 comments:

Laravel ajax file upload

23:49 Unknown 0 Comments

di view

$("#modal-edit-corrective").find('.modal-footer #btn-submit').on('click', function(e){
    var id={!! $incompatibility->corrective->id !!}
    var formdata = new FormData();    
    var file = $("#modal-edit-corrective").find('#attachment')[0].files[0];
    formdata.append('attachment', file);
    formdata.append('_token','{{ csrf_token() }}');
    formdata.append('corrective_action',$("#modal-edit-corrective").find(".modal-body #corrective_action").val());
    formdata.append('preventive_measure',$("#modal-edit-corrective").find(".modal-body #preventive_measure").val());
    $.ajax({
      type:"POST",
      url:"{!! route('corrective.update',$incompatibility->corrective->id) !!}",
      headers: {
              'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
          },
      data:formdata,
      cache:false,
      processData: false,
      async:false,
      contentType: false,
      success:function(){
          window.location.reload();
      }
    })
  })

0 comments:

disable datatable back to page one

18:04 Unknown 0 Comments

disable datatable kembali ke halaman pertama
gunkan

stateSave: true,

0 comments: