javascript - File upload change function submit form? -


i trying post files jquery, didnt come anywhere, thinking if post form instead, when select files, have been same. got problem right now, aint posting form , cant figure out im doing wrong :s

js:

$(".filesupload").on("change", function() {      $("#fileupload").submit(); }); 

html:

<li class="uploadbg">  <form method="post" action="index.php" id="fileupload" enctype="multipart/form-data">     <input type="file" name="filesupload[]" class="filesupload" multiple="">     <a href="#" class="btn btn-xs btn-default">     <span class="fa fa-upload"></span> ladda upp     </a>     </form>     </li> 

css:

.uploadbg { position:relative;} .uploadbg input { width: 94px;height: 24px;position:absolute;top: 10px;z-index:1;opacity: 0;cursor:pointer } 

hope of guys can tell me i'm doing wrong


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -