Return from function with the return value of a callback (nested functions)?
<pre><code>$('form').submit(function() {
    $.post(url, $(this).serialize(), 'validate');
    return .....;
});

function validate(data) {
    return data;
}
</code></pre>

<p>I need to return from the submit function the result that the validate() provides (data). How do I do that? How to make the return of the submit wait until the ajax returns result?</p>
