Select из картинок
Всем добрый день! Имеется допиленный select с выбором картинок из БД по id, но вот как передать значение ID картинки через форму html post увы уже не могу сообразить, вернее подставить в форму в input type=hidden значение переменной c id картинки.Задача передать через html форму в переменной POST id картинки
<script>
$(function(){
$('.photo-options img').click(function(){
$('.photo-options img').attr('class', '');
$(this).toggleClass('active');
$('.result').html('' + $(this).attr('id'));
})
})
</script>
.photo-options{
float: left;
width: 450px;
}
.photo-options img{
width: 200px;
}
/*make css for active option image here*/
.photo-options .active{
border: 2px solid blue;
border-radius: 5px;
}
.result{
float: left;
width: 450px;
}
<div class="photo-options">
<?php
require 'connect.php';
if($_POST['detal'])
{
$id=$_POST['detal'];
$sql=mysql_query("select * from `chertesh` left join `cena` on `cena`.`cher` = `chertesh`.`id` where `chertesh`.id = '$id' order by `cena`.`id_cena`");
while($row=mysql_fetch_array($sql))
{
$translate=$row['translate'];
$operaciya=$row['operaciya'];
$esk=$row['esk'];
echo '<p><a href="javascript:void(0)">
<img id="'.$operaciya.'" alt="'.$translate.'" src="'.$esk.'.jpg"></a>
</p>';
}
}
?>
</div>
<div class="result">