I want to show something like select option, but with images in stead of text. Is that possible? I get the images src by php. Once you select a image I want to take his src to submit my form.
Asked
Active
Viewed 1.0k times
-1
-
Please don't tag-spam. Ex: if you're looking a jQuery solution, then mention it your question (and show your code attempt)... don't just use the [tag:jquery] tag by itself. – Sparky Mar 25 '14 at 15:29
2 Answers
2
Hope this helps...
<select name="selectBox1">
<option value="img1.png" style="background-image:url(img1.png);">male</option>
<option value="img2.png" style="background-image:url(img2.png);">female</option>
<option value="img2.png" style="background-image:url(img3.png);">others</option>
</select>
On submitting the form you will get the selected value inside $_POST["selectBox1"]
post variable.
Thanks.

C M
- 684
- 9
- 22
0
You can use
background-image:url(url here)

Amit Joki
- 58,320
- 7
- 77
- 95
-
1thanks, but that solution only works on firefox. And i would like to show full image. – Mikelon85 Mar 25 '14 at 16:05