Title: Filebox File Upload
Post by: sky-t on July 11, 2017, 06:27:33 AM
I am using the following code <form style="float:right;" id="uploadFile_browse_pictures" enctype="multipart/form-data" method="post"> <input id="filebox_browse_pictures" class="easyui-filebox" data-options="buttonIcon:'icon-add',buttonText:'add image', plain:true" /> </form>
and $(document).ready(function() { $('#uploadFile_browse_pictures').form({ url:'...../api/?request=Images&action=addnew', ajax:true, iframe:false, onProgress: function(percent){ $('#progressFile').progressbar('setValue', percent); }, success: function(data){ $('#filebox_browse_pictures').filebox('setText',''); alert(data); }, onLoadError: function(){ alert('errror'); } }); $('#filebox_browse_pictures').filebox({ onChange: function() { if($('#filebox_browse_pictures').filebox('getValue')!="") { $('#uploadFile_browse_pictures').submit(); } } }); });
When i select i file in the filebox the form will be submitted but there is no file in the request. Where is my error? Thank yout
Title: Re: Filebox File Upload
Post by: patana on July 11, 2017, 11:44:28 PM
Try this: $('#fm_name').form('submit', { url: cur_url, onSubmit: function (param) { //more code here return ($(this).form('validate')); }, success: function (data) { //code here } });
|