クリックイベントを再バインドしてフォームを投稿し、html を ajax しようとしています
$('.btnSave').addClass('yui3-button').click(function() {
var $this = $(this);
var id = $(this).parent().attr('id');
$.post(
"MTrades/save",
$.param({ mycase: 1 }) + '&' + $(this).parent().parent().serialize(),
function(data) {
alert("page - " + data);
$this.parent().fadeOut("fast").load(
"MTrades/index/"+id+"/options",
function() {
//rebind the click event
BindClick();
}).fadeIn("fast");
});
return false;
});
フォームパラメータ送信は初めて機能しますが、(html を保存してリロードした後) .serialize() は空を返します。
html (短縮):
<form id="Form2">
<button>
<div>
<button>save
<form>
<table>
</table>
</form>
</div>
</form>
ありがとう