lightcase
lightcase copied to clipboard
sending multipart/form-data to lightcase
Tried to send form with attach with no success. FormData didn't help me do the trick. How to solve?
$(document).on('submit','form[data-rel=lightcase]', function (event) {
event.preventDefault();
var $this = $(this);
//var formData = new FormData($(this)[0]); <----using this instead of serialize broke the action
$this.lightcase('start', {
type: 'ajax',
href : $this.attr('action'),
ajax : {
width : 550,
type : $this.attr('method'),
href : $this.attr('action'),
dataType : 'html',
data : $this.serialize(), //<--- data sends only text fields
}
});
});
This must be related to your current settings for ajax. I see that contentType is missing in your example.
http://api.jquery.com/jQuery.ajax/