jQuery dialog not working properly
<p>I have the following script:</p>

<pre><code>&lt;script type="text/javascript"&gt;
$( "#addLocation" ).dialog({
            autoOpen: false,
        modal: true,
        height: 700,
        width: 550,
        buttons: {
            "Add Location": function() {
                document.forms["mapform"].submit();
            },
            Cancel: function() {
                $( this ).dialog( "close" );
            }
        },
});
&lt;/script&gt;

&lt;script type="text/javascript"&gt;
function showLocationDialog() {
    $("#addLocation").dialog("open");
}
&lt;/script&gt;

&lt;div id="addLocation" style="display:none;"&gt;
&lt;form action="" method="post" name="mapform"&gt;
&lt;input type="text" name="name" /&gt;
&lt;input type="submit" /&gt;
&lt;/form&gt;
&lt;/div&gt;

&lt;button onclick="javascript:showLocationDialog();"&gt;Add an address&lt;/button&gt;
</code></pre>

<p>The button does not open the dialog and I cannot understand why.. can anyone assist?</p>

<p>Thanks,</p>
