Replies: 3 comments
-
when the dialog box is called for the first time, the variable is passed to getFileCallback, but after closing the window and calling the function with another variable, the getFileCallback function stores the value of the variable that was called the very first time. |
Beta Was this translation helpful? Give feedback.
-
or tell me how to implement passing the url of the file path in the input field. The example needs to work for multiple fields on the page. Since mine works only for one field, and I don't know how to implement it for several. |
Beta Was this translation helpful? Give feedback.
-
@vkirpa82 This is not a question to elFinder, but a question to jQuery. Use |
Beta Was this translation helpful? Give feedback.
-
using a function to insert url into a field
<script type="text/javascript" charset="UTF-8"> function browser_url($name_tag) { $(function(){ var elfinderDialog = $('#dialog_url').dialog({ width: 1000, height: 610, title: 'Manager files', zIndex: 50, create: function(event,ui) { $(this).elfinder({ lang: 'uk', resizable: false, width: 1000, height: 600, url: '/editor/manager/php/connector.php?mode=image', getFileCallback : function(file) { document.getElementById($name_tag).value = file.url; $('#dialog_url').dialog('close'); } }).elfinder('instance'); } }); }); } </script>
but when using multiple fields, getFileCallback only inserts the path into the first field that was opened first. If I understood correctly
document.getElementById ($ name_tag) .value = file.url;
does not work.Using version (2.1 nightly)
<div id="dialog_url" title="Manager files" style="display:none;text-align:left;"></div> <input type='text' id='img1' name="img1" value=""> <input type=button value="Insert" onClick="browser_url('img1')"> <input type='text' id='img2' name="img2" value=""> <input type=button value="Insert" onClick="browser_url('img2')"> <input type='text' id='img3' name="img3" value=""> <input type=button value="Insert" onClick="browser_url('img3')">
Beta Was this translation helpful? Give feedback.
All reactions