ajaxformを使用して、同様のフィールドセットに3つのフォームがあります。私が欲しいのは、フォームが更新されたときに、その親フィールドセットのみを更新することです。$(this) 変数がないため、送信されたフォームのみを更新する ajaxform を指定できません。
$(".toggle-form-submit").parents("form").ajaxForm({
dataType: 'html',
success: function(html) {
var myForm = $(this);
console.log(myForm);
if(myForm.parents("fieldset").find(".replaceable").length) {
updateReplaceableAndClearAndCloseFormWithin(myForm.parents("fieldset"), html);
} else {
longPanelUpdateReplaceableAndClearAndCloseFormWithin(myForm.parents("fieldset"), html);
}
if( $(".test-categories-list").length) {
initSortableTestCases();
}
}
});
どうやら myForm は応答オブジェクトです。私が欲しいのは、現在のフォームのjqueryセレクターで、その親を見つけることができます。ajaxform インスタンス化で変数を設定できないので、どこに $(this)/myForm を設定すればよいですか?