0
 var value1= $(this).attr('id');
 var value2 = $(this).attr('name');
 var value3 = $(this).attr('image');
 $.ajax({
      type: "POST",
      contentType: "application/json; charset=utf-8",
      url: "yoururlhere",
      data: "{'data1':'" + value1+ "', 'data2':'" + value2+ "', 'data3':'" + value3+ "'}",
      success: function (result) {
           //do somthing here
      }
 });

its work POST value but FILE image value empty .

I need to Image file value because inset image url in database.

Balan K
  • 47
  • 1
  • 8

1 Answers1

0

use this send the full form data in ajax request like below

$.ajax({
    url: 'yoururlhere',
    type: "POST",
    data: new FormData(this),
    contentType: false,
    cache: false,
    processData: false,
    success: function(data) {},
});
Vinoth Krishnan
  • 2,925
  • 6
  • 29
  • 34
Vivek Singh
  • 2,453
  • 1
  • 14
  • 27