Home > front end >  About the bootstrap the fileinput using the form to submit a single after delete all files are submi
About the bootstrap the fileinput using the form to submit a single after delete all files are submi

Time:12-22

The great god good:
Demand description: a page to select multiple pictures, supporting a single deleted, use the form to submit documents to form submitted to the background with
Problem description: js initialization is not set uploadUrl properties, image at the bottom right not delete icon appears, so write a false url, the purpose is to show deleted icon)
1. If you don't click on the image of a single deleted, submit the form directly to the background file number is normal,
2. If you click on a single image deletion, page effect is normal, but submit to the background of the files have been emptied,
3. If you choose 3, delete one, then choose one, page shown above 3 (normal), but once again, only delete after submitted to the background to the 1
4. If using asynchronous submission picture, won't appear afore-mentioned problems, but due to project reason, need to use the form to submit
Solving scheme: the fileinput synchronization can submit the form after deleting a single submit to normal background file number

This is to initialize the page HTML file upload more
 & lt; Div & gt; 




This is js initialize components (uploadUrl literally written, because the label images above individual delete) will not be visible until the
 $(" # catTypeUrls "). The fileinput ({
UploadUrl: "upload",
UploadAsync: false,//sync upload
ShowUpload: false,
ShowRemove: false,
AutoReplace: false,
MaxFileCount: 10,
Language: 'useful',
ShowCaption: false,
Enctype: "multipart/form - data ',
AllowedFileExtensions: [" JPG ", "PNG", "GIF"],
MinImageWidth: 50,
MinImageHeight: 50,
MaxFileSize: 2000,
OverwriteInitial: false,//do not cover the existing picture
LayoutTemplates: {
ActionUpload: 'upload button may be removed//set to null
//actionDelete: "//set to null to remove the delete button
}
});

This is a page display

CodePudding user response:

Debugging source code, using asynchronous submission called when the source of the upload function, and use the form to submit not call this function, the function did a series of processing
Or have a great god knows when the form submission take the fileinput data is taken from where (function)?

CodePudding user response:

A great god, and I also met the same problem, would you solved? The card 2 days thank god!

CodePudding user response:

refer to the second floor u013931282 response:
great god, and I also met the same problem, can you solve it, please? The card 2 days thank god!

This plugin when submit the form directly submit original file the dom object, can only get the last selected file, because will have the same file, select multiple values save the final choice, and ajax submit FormData, dom change every file that can add content to the FormData, delete will be deleted from the FormData

Operation is not the same file object, must can refer to this form submission, and batch upload: upload multiple file selection jquery plug-ins, in the form is submitted

CodePudding user response:

Hello I uploaded successfully with thumbnails and how the background after delete link?

CodePudding user response:

Finally how to solve the urgent urgent eldest brother
  • Related