ドロップされた項目(jqueryui draggables/droppables/sortablesを使用)から取得した要素IDから取得したデータを、ここでデータと共にフォーム(電子メールで送信)を介して送信する必要があります。フォーム送信時に要素IDを送信する
function getSku() {
var myIds = new array();
$("#collection li").each(function(index, element){
alert($(this).attr('id'));
myIds.push(element.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を取得するための機能がこれです
<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>
誰でも私に助けを与えることができますか?
そして、あなたはsend_tile.phpであなたの第二の例ではmyIds配列 –