简体   繁体   中英

Image-picker html form

I'm having issues using Image-picker http://rvera.github.io/image-picker/

Basically i have managed to display the images I want, but i would like to wrap it all in an html form calling another php script and providing that php script the value from the selected image

<form action="dosomething.php" method="get" >
<select id="selectImage" class="image-picker">
<option data-img-src="files/1.jpg" input type="text" name="img" value="1">1</option>
<option data-img-src="files/2.jpg" input type="text" name="img" value="2">2</option>
<option data-img-src="files/3.jpg" input type="text" name="img" value="3">3</option>
</select>
<input type="submit" value="Submit">
</form>

When i click on the form submit action, i get pointed to dosomething.php but my values are never passed through get

Could anyone give me some insight?

Thanks in advance

You need to name your select tag.

eg.

<select id="selectImage" class="image-picker" name="image">

then try to retrieve with $_GET['image'];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM