More accordion

More accordion

I have an accordion setup that loads each record from a database as a selector, which then contains the results of multiple subsequent queries.  I currently use a dialog form containing a select list for the property unit you want to insert the data.  I would rather have a button within each selector that opens the dialog form pre-populated with the value I want for the property unit.  I can't find an example of how to have the specific button pass an arguement to the form.  I appreciate the help!

My button currently looks like:

  1. <a href="#" id="DialogAddGameButton" class="dialog ui-state-default ui-corner-all"><span class="ui-icon ui-icon-newwin"></span>Add Game</a>

Which calls:

  1.                     // Game Dialog
  2.                     $('#AddGameForm').dialog({
  3.                         autoOpen: false,
  4.                         width: 600,
  5.                         buttons: {
  6.                             "Ok": function() {
  7.                                 $(this).dialog("close");
  8.                                  AddGame(function(){
  9.                                  });
  10.                             },
  11.                             "Cancel": function() {
  12.                                 $(this).dialog("close");
  13.                             }
  14.                         }
  15.                     });