I have a file browser input, when user select a local file,I want set the path to a input box automatic at the file input's onChange event. but it is not response... why???
like the following code:
like the following code:
CKEDITOR.dialog.add( 'QuickUploadDia', function( editor ) { return { title : 'Add a image', minWidth : 400, minHeight : 200, contents : [ { id : 'addImage', label : 'Add image', title : 'Add image', filebrowser : 'uploadButton', elements : [ { id : 'txtUrl', type : 'text', label : 'Image URL', required: true, style:"display:none" }, { id : 'upload', type : 'file', label : 'Upload a image', style: 'height:40px', size : 38 , onChange:function(){ if (navigator.userAgent.indexOf("Firefox")!=-1 || navigator.userAgent.indexOf("Mozilla")!=-1){ try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); } catch (e) { return; } } console.log(this.getValue()); $("a.cke_dialog_ui_fileButton:first").click();//here is not response why??? } }, { type : 'fileButton', id : 'uploadButton', label : 'Upload', filebrowser : { action : 'QuickUpload', url : '/action/ckeditor/quickUpload', target : 'addImage:txtUrl' }, 'for' : [ 'addImage', 'upload'] } ] } ], onOk : function(){ } }; } );