Added ability to upload a receipt from the user page

This commit is contained in:
Tom Bloor 2017-04-20 17:33:59 +01:00
parent 2cc670b58f
commit d1add8ee7c
6 changed files with 208 additions and 24 deletions

View file

@ -0,0 +1,4 @@
body {
background: whitesmoke;
padding-top: 70px;
}

View file

@ -0,0 +1,24 @@
$(function() {
$('form#receipt-form').submit(function( event ) {
event.preventDefault();
event.stopPropagation();
// Create new form data object with the contents of this form
var formData = new FormData(this);
$.ajax({
url: $(this).attr("action"),
type: 'POST',
data: formData,
success: function(data) {
alert(data);
},
cache: false,
contentType: false,
processData: false
});
// Stop propogation of event
return false;
});
});