diff --git a/application/views/inspectionform.php b/application/views/inspectionform.php index 6223754..d380969 100644 --- a/application/views/inspectionform.php +++ b/application/views/inspectionform.php @@ -336,11 +336,11 @@ function uploadFile() { contentType: false, processData: false, success:function(response){ - console.table(response.files); - console.log(response.hm); + + $.each(files, function(k, url) { -/* document.getElementById('results').innerHTML += - '
'; +document.getElementById('results').innerHTML += + '
'; var input = document.createElement("input"); @@ -348,11 +348,13 @@ function uploadFile() { input.setAttribute("name", "inspimg["+i+"]"); -input.setAttribute("value", response.url); +input.setAttribute("value", files[k]); //append to form element that you want . -document.getElementById("imagefields").appendChild(input); */ - } +document.getElementById("imagefields").appendChild(input); +i=i+1; + }); + } });