我在使用图像选择器 http://rvera.github.io/image-picker/ 时遇到问题
基本上我已经成功地显示了我想要的图像,但我想将其全部包装在一个 html 表单中,调用另一个 php 脚本并为该 php 脚本提供所选图像的值
<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>
当我单击表单提交操作时,我被指向 dosomething.php 但我的值从未通过 get 传递
有人能给我一些见解吗?
提前致谢
最佳答案
您需要命名您选择的标签。
例如。
<select id="selectImage" class="image-picker" name="image">
然后尝试使用 $_GET['image'];
进行检索
关于javascript - 图像选择器 html 表单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26006905/