Jquery 在对话框窗口中获取提交按钮的值

Jquery 在对话框窗口中获取提交按钮的值,jquery,Jquery,我在JqueryUI中使用了手风琴功能。在每个项目中都有一个带有名称的提交按钮。名称是我在对话框窗口中需要的id。当我点击submit按钮时,使用此功能 $( ".opener" ).click(function() { console.log( $(this).attr("name")); $( "#dialog-confirm" ).dialog( "open" ); }); 在我的控制台日志中,我现在看到了正确的id。但在对话框窗口中,我无法获取此id

我在JqueryUI中使用了手风琴功能。在每个项目中都有一个带有名称的提交按钮。名称是我在对话框窗口中需要的id。当我点击submit按钮时,使用此功能

$( ".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" );
    }
  }
});
$(函数(){
$(“#对话框确认”)。对话框({
自动打开:错误,
展示:{
效果:“褪色”,
持续时间:500
},
隐藏:{
效果:“褪色”,
持续时间:200
},
可调整大小:false,
身高:180,
莫代尔:是的,
按钮:{
“Aannemen”:函数(){
$(此).dialog(“关闭”);
警报('ID IS');
var名称;
$(“.opener”)。单击(函数(){
name=$(this.attr(“name”);
$(“对话框确认”)。对话框(“打开”);
});
$(函数(){
$(“#对话框确认”)。对话框({
自动打开:错误,
展示:{
效果:“褪色”,
持续时间:500
},
隐藏:{
效果:“褪色”,
持续时间:200
},
可调整大小:false,
身高:180,
莫代尔:是的,
按钮:{
“Aannemen”:函数(){
$(此).dialog(“关闭”);

提醒(姓名);没有,但我必须等10分钟才能做到;)你在哪里快速;)
var name;
$( ".opener" ).click(function() {
        name =$(this).attr("name");
      $( "#dialog-confirm" ).dialog( "open" );
});

$(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(name);       << this is where you get the id
    },
    Cancel: function() {
      $( this ).dialog( "close" );
    }
  }
});