我需要从删除的项目(使用 jqueryui draggables/droppables/sortables)中提取的元素 id 中获取的数据通过表单(通过电子邮件发送)连同此处的数据一起发送:
function submitForm() {
$.ajax({type:'POST',
url: 'send_tile.php',
data:$('#tiles_collected').serialize(),
success: function(response) {
$('#tiles_collected').find('.form_result').html(response);
}});
return false;
}
获取ID的功能是这样的(不确定它是否工作正常):
function getSku() {
var myIds = new array();
$("#collection li").each(function(index, element){
alert($(this).attr('id'));
myIds.push(element.id);
});
表格如下所示:
<form id="tiles_collected" name='tiles_collected' method="post" onsubmit="return submitForm();">
Email:<input name='email' id='email' type='text'/><br />
Name:<input name='name' id='name' type='text' /><br />
Zip code: <input name='zip' id='zip' type='text' /><br />
<input type='hidden' id='sku' />
<input type="submit" name="submit" value="Email collection to yourself and us" /><br/>
<div class="form_result"></div>
</form>
谁能给我一个帮助?