I have a list of images where I want users to be able to click on an image and it submits the data with jquery. So given several images, a user can click on any one of them and it automatically submits to a jquery landing page with the id of the image that the person has chosen. Here is my attempt at the code using a list as images..
<ul>
<li><img id='1' src='/img1.png'></li>
<li><img id='2' src='/img2.png'></li>
<li><img id='3' src='/img3.png'></li>
</ul>
$(function()
{
$('#img').click(function()
{
var datastring = //either 1,2,3 corresponding to image id
$.ajax({
type: "POST",
url: "process.php",
data: dataString,
success: function() {
alert('Image Submitted')
}
});
}