I cannot get a return code from my javascript function
<p>I assign the following to a button on a modal. When the user clicks
on the button it calls submitHandler.</p>

<pre><code>   var btn = {
        'Submit &amp; Close': function (win) {
            var rc = submitHandler(oLink.$link, $modal);
            $('#createLink').prop('disabled', false);
        },
        'Close': function (win) {
            $modal.closeModal();
            $('#createLink').prop('disabled', false);
        }
    }
</code></pre>

<p>My submitHandler looks like this:</p>

<pre><code>    function submitHandler($link, $modal) {

  if (!$form.valid || $form.valid()) {
        $submitBt.disableBt();
        $modal.removeBlockMessages()
            .blockMessage('Contacting Server, please wait ... ', { type: 'loading' });
        $.ajax({
            url: oSubmit.href,
            dataType: 'json',
            type: 'POST',
            data: $form.serializeArray()
        })
        .done(function (json, textStatus, XMLHttpRequest) {
            json = json || {};
            if (json.success) {
                submitSuccessModal(oSubmit, json);
                return true;
            } else {
                submitFailModal(oSubmit, json);
                return false;
            }
            return false;
        })

    }
</code></pre>

<p>When I check in the debugger submitHandler runs but when I look at the value of 
rc it is undefined. </p>

<p>Is there something obvious I am missing. I simply cannot get rc to equal
anything other than "undefined". </p>

<p><strong>Update:</strong></p>

<p>I added in an actual section of the code. I am wondering if it could be the ajax call that's causing this? Note that I can follow the code with the debugger to the return true; line.</p>
