JqueryUI でアコーディオン関数を使用しています。各項目には、名前の付いた送信ボタンがあります。名前は、ダイアログ ウィンドウで必要な ID です。送信ボタンをクリックすると、この関数が使用されます
$( ".opener" ).click(function() {
console.log( $(this).attr("name"));
$( "#dialog-confirm" ).dialog( "open" );
});
コンソール ログに正しい ID が表示されるようになりました。しかし、ダイアログ ウィンドウでは、この ID を取得できません。これはダイアログウィンドウです
$(function() {
$( "#dialog-confirm" ).dialog({
autoOpen: false,
show: {
effect: "fade",
duration: 500
},
hide: {
effect: "fade",
duration: 200
},
resizable: false,
height:180,
modal: true,
buttons: {
"Aannemen": function() {
$( this ).dialog( "close" );
alert('ID IS'); << this is where i want the id
},
Cancel: function() {
$( this ).dialog( "close" );
}
}
});
では、スクリプトのこの位置の ID を取得するにはどうすればよいでしょうか: alert('ID IS');