reset upload fields

Home Forums Quform PHP reset upload fields

This topic is: resolved
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #33625
    beachmatt
    Participant

    I was asking on Envato about being able to reset upload fields and you suggested inserting this link

    Reset

    next to the field, and inserting this into the scripts.js file:

    $('.reset-file').on('click', function (e) {
        e.preventDefault();
        var $files = $(this).closest('.quform-element').find('input[type="file"]');
    
        $files.each(function () {
            $(this).replaceWith($(this).val('').clone(true));
        });
    });

    but I cannot get it to work. I’ve put the link directly under the div containing the upload field. See here

    Thanks

    • This topic was modified 1 month ago by beachmatt.
    • This topic was modified 1 month ago by beachmatt.
    • This topic was modified 1 month ago by beachmatt.
    • This topic was modified 1 month ago by beachmatt.
    #33630
    beachmatt
    Participant

    Sorry I can’t get the system to preserve the link as you gave it, but it has a class of reset-file.

    #33639
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #33647
    beachmatt
    Participant

    That works, thanks.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2020 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy