BootStrap Smart form series nine form picture upload support

Source: Internet
Author: User

This chapter describes how you can preview a picture after you've created it, and you'll be able to support uploading it.

The code is as follows (Connection address: https://github.com/xiexingen/Bootstrap-SmartForm/blob/master/demo/form3-ele-img.html):

    • dependent on the Jquery-file-upload plug-in, you need to reference Jquery.ui.widget.js, Jquery.iframe-transport.js, jquery.fileload.js
    • Call global.Fn.InitPlugin(‘img‘,‘formContainer‘); Formcontainer: For the form ID, narrow the look-up range, optional
    • The principle of this plugin is to upload the image to the server, and then the server returns the path of the picture storage, the last time the form is submitted to the image of the path to the server storage, parameter description:

      ID: ' Can be arbitrarily given, mainly used to distinguish '

      Multiple: ' True ', whether to allow multiple files when uploading

      Name: When uploading a file, the submitted key

      Extendattr:field: When saving a form, the key name sent is handle: optional [single|mutiple|null] if it is single, the uploaded picture will replace the existing picture, otherwise it will be appended to the current picture

      URL: Image upload submitted URL, you can also modify the Global.js file in the global.Fn.InitUploadImage inside the default values

      Note: This method defaults to the returned JSON format: {result:200,imgurl: ' ... '},result:200 to show that the picture was uploaded successfully!

Run:

Previous chapter:BootStrap Smart Form series eight form configuration json detailed

Previous chapter: BootStrap smart Form Series 10 auto-complete component support

Series Home: BootStrap smart Form Series Home

BootStrap Smart form series nine form picture upload support

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.