Skip Navigation

[Resolved] Upload image layout

This support ticket is created 4 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by arisG 4 years, 8 months ago.

Assisted by: Waqar.

Author
Posts
#1320339

Hello,

we would like to change the default layout of "Upload Image"

we have followed this article and add the code

hidden link

 <div class="container">
          <div class="col-md-6">
              <div class="form-group">
                  <label>Επιλογή Φωτογραφίας</label>
                  <div class="input-group">
                      <span class="input-group-btn">
                          <span class="btn btn-default btn-file">
                              Αναζήτηση… <input type="file" id="_featured_image_file" name="_featured_image">
                          </span>
                      </span>
                      <input type="text" class="form-control" readonly>
                  </div>
                  <img id='img-upload'/>
              </div>
          </div>
        </div>

It works but we can't find how to add a reset button to clear/delete the uploaded feature image.

How we can do that?

Thank you.

#1320807

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi there,

Thank you for contacting us and I'd be happy to assist.

Although 1-1 customization assistance is beyond the scope of the support that we provide, we do our best to guide in the right direction, whenever possible.

To clear/remove the selected image, you can include a reset button inside your form like this:
( ref: hidden link )


<input type="reset" id="reset-btn">

Clicking this button will automatically remove the selected image from the image upload field.

To remove the image from the preview container below, you'll need to include some additional script, that triggers when the reset button is clicked:
( screenshot: hidden link )


$("#reset-btn").click(function(){
	$('#img-upload').attr('src', '');
});

I hope this helps and for more personalized assistance around custom code, you can also consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/

regards,
Waqar

#1321023

Hello Waqar,

appreciate your help.

Thank you.

This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.