Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I link a combobox to a folder of images?

In the body of HTML I have <input type="file" id="img" multiple><br> <input type="submit" onclick="loadfiles()">

In Javascript I have:

function loadfiles() {
  var viewer = new PhotoViewer();
  var imageFiles = document.getElementById("img"),
  filesLength = imageFiles.files.length;
  for (var i = 0; i < filesLength; i++) {
    viewer.add('./Slide1/'+imageFiles.files[i].name);
  }
  viewer.show(0);

Here, what I am doing is selecting multiple files from the specific folder and those files are showing in the jQuery slider. But I want to do it as a combobox of folders: whichever folder I choose, it will show all the images present in that folder using the same jQuery slider.

<form name=myform>
  <select id="mytextarea" name=mytextarea size=1>
    <option name=one value=one> one </option>
    <option name=two value=two> two </option>
    <option name=three value=three > three </option>
    <option name=four value=four> four </option>
  </select>
</form>

How can I can get a link to the folder?

like image 611
insanity Avatar asked Jul 11 '13 06:07

insanity


1 Answers

You can pass reference of combo Box to function

<input type="file" id="img" multiple><br> <input type="submit" onclick="loadfiles(this)">

function loadfiles(obj) {
  var selectedOption = obj.val();
  }
like image 54
Jatin patil Avatar answered Nov 10 '22 08:11

Jatin patil