Skip to content

Instantly share code, notes, and snippets.

Created July 1, 2022 08:06
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save dislokacia/b99db3f307ab30a06644b64997dd93ec to your computer and use it in GitHub Desktop.
JetEngine media field text after upload
jQuery(document).ready(function( $ ){
let upload = $(this).find('.jet-engine-file-upload__input');
$(this).append('<input type="button" class="addfile" value="Choose file"/>');
$(this).append('<label class="labeladdfile">Choose file</label></div>');
let labelAdd = $(this).find('.labeladdfile');
let buttonAdd = $(this).find('.addfile');
let uploadValue = $(this).find('.jet-engine-file-upload__value');
$(this).find('.addfile').click(function () {
let buttonDelete = $(this).siblings('.jet-engine-file-upload__content').find('.jet-engine-file-upload__files');
$(this).find('.jet-engine-file-upload__input').on('change', function(){
if( uploadValue[0].value === "is-hidden" ){
labelAdd.html("Choose file");
} else {
labelAdd.html("file uploaded");
buttonAdd.attr('value', 'File Uploaded')
buttonDelete.on('click', function(){
labelAdd.html("Choose file");
buttonAdd.attr('value', 'Choose file')
Copy link

Add this code to this plugin
And it will work like on video
Code is only for JetEngine Forms only
You can change the text of the button and label, as you need
All stylings for button will be taken from the theme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment