Gravity Forms image upload preview

Gravity forms is like magic, you can create a form with advanced options without any real knowledge of coding. The basic plugin does not offer a way to show image previews for uploaded images, but with a little extra code it is easily implemntated.

The code is just copy paste while changing 2 numbers. Anybody kan do it.

First you need an image upload field:

    1. We set the extensions to only allow the image type we set
    1. Then we set the maximum upload size to 5MB

After the upload field we place the preview field: a HTML block. Add it to your form. We need two numbers:

  • the form id.
  • the field id (from the upload field)

Now we can fill the content of our HTML block with the code we need:

The line below ‘change this’ you change the 1 to be your form id and the 12 to be you field id and that’s it