Particular case: Programmed Query string using form inside dialog

Particular case: Programmed Query string using form inside dialog

Place a part of my project.
When I run this code and I click add on the window.
Firebug responds with an error when I run the script in to submit.
I would like to know why does not this `alert ("Se funziona questo mi hai aiutato");`

http://api.jquery.com/submit/

There is a example at the end of the site and also works on my pc.
Now I public my code or exercise where I use the form inside the window's dialog(Jquery).
I want programmed and I have the solution but the script inside the function's javascript don't function.
Why?
Now I speak my project.
Using the dialog's window (Jquery my code) for adding anything.
The project don't function. Because (using Firebug Console)  gives me error "too much recursion" on the library jquery.min.js line 2 after pressing the button add the Dialog.
How can I improve the code to run the alert?

My Project:

    <html>
      <head>
        <title></title>
       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <style></style>
      </head>
         <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
        <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js"></script>
     <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript">
    // <---- VENTAÑAS DE PARAMETERES---->
    $(document).ready(function() {
    var regex,v,l,c,b,i,contapara=3;
    $( "#wnd_Addparam" ).dialog({
                autoOpen: false,
                height: 'auto',
                width: 350,
                modal: true,
                resizable:false,
                buttons: {
                    "Add": function() {
                                     contapara=(parseInt(contapara)+1);
    alert("popopo");
                    $("#formparam").submit(function() {
                                  alert("Se funziona questo mi hai aiutato");
                        });
                                    $( this ).dialog( "close" );
                                       },
                    Cancel: function() {
                        $( this ).dialog( "close" );
                    }
                },
                close: function() {
                    $( this ).dialog( "close" );
                }
            });
   
            $( "#btn_Addpar" ).click(function() {
                            i=(parseInt(contapara)+1);
                            $("#formparam").remove();
        $("#wnd_Addparam").append('<form method="GET" name="formparam"  id="formparam" action="${nextstep}"><table><tr><td><label>ID</label></td><td>\
        <textarea class="expand" name="inputp'+i+'_id" id="inputp'+i+'_id"></textarea></td></tr>\
        <tr><td><label>Type</label></td><td><select name="inputp'+i+'_type" id="inputp'+i+'_type">\
        <option value="text">Text</option><option value="integer">Integer</option><option value="float">Float</option>\
        <option value="list_values">List of values</option><option value="range">Range</option>\
        <option value="selection_collapsed">Selection (collapsed)</option>\
        <option value="selection_expanded">Selection (expanded)</option>\
        <option value="subimage">Subimage selection</option>\
        <option value="polygon">Polygon selection</option>\
        <option value="horizontal_separator">Horizontal separator</option>\
        </select></td></tr></table></form>');
   
                   
   
                    $( "#wnd_Addparam" ).dialog( "open" );
                });
    });
    </script>
      <body>
    <div>
     <input type="button" id="btn_Addpar" value="Add"/>
    <input type="button" id="btn_Deletepara" value="Delete"/>
    <input type="button" id="btn_Pedit" value="Edit"/>
    </div>
    <div id="wnd_Addparam" title="New parameter" ></div>
    </body>
    </html>

I look also this question http://stackoverflow.com/questions/6087634/how-to-change-the-querystring-when-i-submit-my-get-form-using-jquery and he used (always inside the function's submit) this script:

 

       function(event) {
                event.preventDefault();
                $this = $(this);
                alert("Se funziona questo mi hai aiutato");
    }

But don't function.