0

I am facing on problem my submit function not working I don't know where is the problem. I am using laravel framework 5.2 h

$('#CheckImageCount').on('click', function() {
  var arr = [];
  $('.table-error').find('tr').each(function() {
    if ($(this).find('td:eq(1)').find('select').val() != '') {
      if ($(this).find('td:eq(2)').find('select').val() == '') {
        arr.push('false');
      } else {
        arr.push('true');
      }
    } else {
      arr.push('true');
    }
  });
  if ($.inArray('false', arr) > -1) {
    swal("Alert!", "Please Select Working Hours in right way!")
    return false;
  } else {
    $.ajax({
      type: 'POST',
      url: 'CheckImageCount',
      success: function(resp) {
        if ($.trim(resp) == "empty") {
          $('.error-1').fadeIn('fast').delay(1000).fadeOut('fast');
          return false;
        } else {
          $("#registerBusiness").submit(); // here i want to submit the form
        }
      },
      error: function() {}
    });
  }
});

My form id is registerBusiness it not submit the form even my page not
goto that function here is my form and submit button

<form id="registerBusiness" role="form" method="POST" action="{{ url('/business-for-sale' )}}">{{ csrf_field() }}

And Submit buttton

<button id="CheckImageCount" type="button" class="btn btn-info">Save And Continue </button>
mplungjan
  • 169,008
  • 28
  • 173
  • 236
kunal
  • 4,122
  • 12
  • 40
  • 75

0 Answers0