EasyUI Forum
May 02, 2024, 01:27:49 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Filebox File Upload  (Read 6888 times)
sky-t
Full Member
***
Posts: 145


View Profile
« on: July 11, 2017, 06:27:33 AM »

I am using the following code

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

Code:
$(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
Logged
patana
Jr. Member
**
Posts: 50


View Profile
« Reply #1 on: July 11, 2017, 11:44:28 PM »

Try this:
Code:
$('#fm_name').form('submit', {
                url: cur_url,
                onSubmit: function (param) {
                    //more code here
                    return ($(this).form('validate'));  
                },
                success: function (data) {
                    //code here
                }
});
« Last Edit: July 11, 2017, 11:47:26 PM by patana » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!