JavaScript Disable Drag and Drop Functionality for jQuery-File-Upload disable drag drop javascript,disable drag drop css,disable drag

I'm using ajax file uploader on my pages. https://github.com/blueimp/jQuery-File-Upload

I'm using one control for image uploading and another for file uploading and both are on the same page.

I've added the validation to check the file type in both of the file uploaders but when I drag and drop resume on my file uploader then it will catch the image uploader event.

I want to disable the functionality of drag and drop for image uploader so it will not trigger when i drag my resume.

Here's my code,

$(function () {

        var userId = $("#CandidateProfile_user_id").val();    
        var url = 'index.php?r=fileUpload/uploadResume';
        $('#resumeUpload').fileupload({
            add: function(e, data) {
                var uploadErrors = [];
                var acceptFileTypes = /^document\/(doc|docx)$/i;

                var fileName = data.originalFiles[0].name;
                var fileExtension = fileName.split('.')[1];

                if(fileExtension.toLowerCase() != "doc" && fileExtension.toLowerCase() != "docx") {
                      uploadErrors.push('Not an accepted file type');
                }
//                if(data.originalFiles[0]['type'].length && !acceptFileTypes.test(data.originalFiles[0]['type'])) {
//                    uploadErrors.push('Not an accepted file type');
//                }
                if(data.originalFiles[0]['size'].length && data.originalFiles[0]['size'] > 5000000) {
                    uploadErrors.push('Filesize is too big');
                }
                if(uploadErrors.length > 0) {
                    alert(uploadErrors.join("\n"));
                } else {
                    data.submit();
                }
        },
        url: url,
        dataType: 'json',
        formData: {userId : userId},       
        done: function (e,data) {

            onFileUploaded(data.result.fileName,data.result.filePath);

            //Update the pic
           // $("#userPic").attr('src',data.result.imagePath);

            //set the image name
           // $("#CandidateProfile_image_name").val(data.result.imageName);

            //console.log(data);
        },       
    }).prop('disabled', !$.support.fileInput)
        .parent().addClass($.support.fileInput ? undefined : 'disabled');
});

Thanks, Faisal Nasir

Answer:1

Trying to paint each cube face with a different color, I found a thread that presents a way to achieve this: var geometry = new THREE.BoxGeometry(5, 5, 5); for (var i = 0; i < geometry.faces....

Trying to paint each cube face with a different color, I found a thread that presents a way to achieve this: var geometry = new THREE.BoxGeometry(5, 5, 5); for (var i = 0; i < geometry.faces....

  1. cube painted faces

I try to use ContextMenu to run DeleteMaker function, but ContextMenu just get marker current Latlng, not like other leaflet events like "click", "dblclick" ... what can get marker options info. ...

I try to use ContextMenu to run DeleteMaker function, but ContextMenu just get marker current Latlng, not like other leaflet events like "click", "dblclick" ... what can get marker options info. ...

  1. leaflet marker options r
  2. leaflet marker options example
  3. leaflet marker options
  4. leaflet marker cluster options
  5. leaflet update marker options
  6. leaflet change marker options
  7. leaflet circle marker options
  8. leaflet marker set options
  9. leaflet get marker options
  10. leaflet default marker options
  11. leaflet marker icon options
  12. leaflet marker custom options
  13. leaflet marker popup options
  14. leaflet draw marker options
  15. leaflet js marker options
  16. leaflet marker bindpopup with options
  17. r leaflet marker cluster options

I have a component that I need to re-mount. I need to destroy everything and make it's code re-execute to appear again on my page. What I've tried: I put key="1" and then with javascript changed its ...

I have a component that I need to re-mount. I need to destroy everything and make it's code re-execute to appear again on my page. What I've tried: I put key="1" and then with javascript changed its ...

  1. reactjs remount component

Well, I'm using object orientation in JavaScript, but instead of using new, I just call the method from the namespace. In the moment, I have the following code: var Component = { Button: function(...

Well, I'm using object orientation in JavaScript, but instead of using new, I just call the method from the namespace. In the moment, I have the following code: var Component = { Button: function(...