Getting the content of a variable outside the submit function event
<p>This is my 3rd question so please understand :).</p>

<p>I have this submit function - nothing fancy, just a serializeArray() and some retrieved values:</p>

<pre><code>$("#myform").submit(function(){

    var formdata = $(this).serializeArray();
    var values = {};

    $.each(formdata, function(i, field){
        values[field.name] = field.value
    });

    var id = values["mrmid"];


});
</code></pre>

<p><strong>How can I pass the id variable outside the submit function event so I can write the content of the variable id on this div?</strong></p>

<pre><code>$("#results").html(id);
</code></pre>

<p>Thank you!</p>
