barryvdh / laravel-elfinder

elFinder bundle for Laravel
745 stars 171 forks source link

standalone popup doesn't set field value #231

Open hilmanfaiz opened 6 years ago

hilmanfaiz commented 6 years ago

Hi,

I use standalone popup (with colorbox as suggested in readme.md). I run a problem where after I choose a file, my input field doesn't get updated. I tried adding console.log in function processSelectedFile() and it does log in my console.

function processSelectedFile(filePath, requestingField) { console.log(requestingField); $('#'+requestingField).val(filePath).trigger('change'); }

So I tried $('#'+requestingField).remove() to check and it works...

colorbox.css is in <head> jquery.colorbox-min.js is right before head closing </head> standalonepopup.js is right before body closing </body>

any suggestion? thanks

hilmanfaiz commented 6 years ago

Just now I found a workaround. Instead of .val(filePath), I use .attr("value",filePath) and it works for me.