我有一个提交类型为图片数量的表单。每张图片都有不同的标题。我需要找出点击图片的标题。但是我的表单提交里面的点击功能不起作用。jquery点击函数里面的表单提交功能
我的形式是:
<form action='log.php' id='logForm' method='post' >
<?
for($j=1;$j<=5;$j++)
{
?>
<input type="image" src="<?=$img;?>" title="<?=$url;?> id="<?="image".$j?> class="images" />
<?
}
?>
</form>
的Jquery:
$("#logForm").submit(function(e)
{
$(".advt_image").click(function(event) {
var href=event.target.title;
});
var Form = { };
Form['inputFree'] = $("#inputFree").val();
// if($("#freeTOS").is(":checked"))
Form['freeTOS'] = '1';
$(".active").hide().removeClass('active');
$("#paneLoading").show().addClass('active');
var url="http://"+href;
$.post('processFree.php', Form, function(data)
{
if(data == "Success")
{
$("#FreeErrors").html('').hide();
swapToPane('paneSuccess');
setTimeout(function() { location=url }, 2500);
return;
}
swapToPane('paneFree');
$("#FreeErrors").html(data).show();
});
return false;
});
我怎样才能获得点击图像的这种$("#logForm").submit(function())
内标题价值?
如何使用点击图像的ID?
什么用的缩进? – elclanrs