title: jquery dialog() ok will submit php $GET variable
body: <p>Using jquery dialog I have created a popup box with a form. 
  I am writing php code and I want to use the least javaScript possible.
  I would like to submit the form using php sending $GET variables (I have complex actions with the database to perform). 
  Is there a way to do this? 
  My code is: </p>
  
  <pre><code>         $( "#dialog-form" )
              .dialog({
                  autoOpen: false,
                  title: "Add Images",
                  buttons: {"Ok": function() 
                                      //I want to submit a $GET variable }},
                  draggable: false,
                  resizable: false 
          });
  
          $("#addImage")
              .click(function() {
              $( "#dialog-form" ).dialog("open");
          });     
  
  
  //form 
  &lt;div id="dialog-form"&gt;
  
      Xml::openElement( 'form', array(
              'action' =&gt; $action,
              'method' =&gt; 'get')). 
          );  
  
         Xml::radio('name=addimage', 'value', 'he') . 'Choose from Exisiting'.
             Xml::radio('name=addimage', 'value=go')  . 'Upload Image'
             //I want to have a XML::submit('ok') button to submit the form. I've tried putting this in but it doesn't do anything.                                               
                 Xml::closeElement( 'form' );
           &lt;/div&gt;
  &lt;button id="addImage"&gt;Add Image&lt;/button&gt;
  </code></pre>
  
  <p>my complete code: 
  function fnAddImages(){
      global $wgOut, $wgHooks, $wgUser;</p>
  
  <pre><code> // import addimage javascript and css files
    $wgOut-&gt;addScript('&lt;script type="text/javascript" src="extensions/AddImages/addimages.js"&gt;&lt;/script&gt;');
    $wgOut-&gt;addScript('&lt;script type="text/javascript" src="extensions/AddImages/js/jquery-1.7.1.min.js"&gt;&lt;/script&gt;');
    $wgOut-&gt;addScript('&lt;script type="text/javascript" src="extensions/AddImages/js/jquery-ui-1.7.3.custom.min.js"&gt;&lt;/script&gt;');
    $wgOut-&gt;addScript('&lt;link type="text/css" href="extensions/AddImages/css/blitzer/jquery-ui-1.7.3.custom.css" rel="Stylesheet" /&gt;');      
    $wgOut-&gt;addScript("&lt;style&gt;@import url( extensions/AddImages/style.css);&lt;/style&gt;");
  
    //Add Image button with popup onclick
  $wgOut-&gt;addScript('&lt;script type="text/javascript"&gt; 
      ( function($) {
          $(document).ready(function() {
          $( "#dialog-form" )
              .dialog({
                  autoOpen: false,
                  title: "Add Images",
                  buttons: {"Okay": function() {$("#dialog-form form").submit(); }},
                  //{"Cancel": function() { $(this).dialog("close"); }},
                  draggable: false,
                  resizable: false 
          });
  
          $("#addImage")
              .click(function() {
              $( "#dialog-form" ).dialog("open");
          });
          });     
  
      } ) ( jQuery );
  
  &lt;/script&gt;'); 
  //form 
  
  
  $wgOut-&gt;addHTML('&lt;div id="dialog-form"&gt;'); 
  
  
  $wgOut-&gt;addHTML(
      Xml::openElement( 'form', array(
              'action' =&gt; '..' ,
              'method' =&gt; 'get')). 
          Xml::hidden( 'wpEditToken', $wgUser-&gt;editToken() )
          );  
  
  $wgOut-&gt;addHTML( 
               Xml::radio('name=addimage', 'value', 'he') . 'Choose from Exisiting'.
                     "&lt;br /&gt;" .
                  Xml::radio('name=addimage', 'value=go')  . 'Upload Image'.
                     "&lt;br /&gt;" .
                  // Xml::submitButton('Ok') .
                 Xml::closeElement( 'form' )
              );
  $wgOut-&gt;addHTML('&lt;/div&gt;');
  $wgOut-&gt;addHTML('&lt;button id="addImage"&gt;Add Image&lt;/button&gt;');
  
  
  //retun true to run hook function  
  return true;
  </code></pre>
  
  <p>}</p>
  
  <p>I am running it on a mediawiki site. 
  I'm trying to create a 'add image' button that will give you a radio button form so you can choose to 'upload your own image' or 'existing image'. I need to press 'ok' so I can code functions that will pull data from the database or show a new popup box for uploading images. 
  Thanks for your help.</p>