How to Submit only after Jquery finished updating the field
<p>I have a form where a user inputs a word, when pressing the button I want it to translate the word (using the jquery script) into the same field. 
Only after completed to populate the field, it should continue and submit the translated word.</p>

<p>everything is working except that it will submit as soon as it translating causing the original word to be submitted instead of the translated one.
the original page shows that the word had been translated.</p>

<p>please help on how to make it submit only after the word have been translated in the text field. ? 
should I use a delay ? if so how ?
or is there an oncomplete, "onpopulate" or something like that ?</p>

<p>here is the script: </p>

<pre><code>&lt;script type="text/javascript"&gt;     
$(function transle() {  
    $('#transbox').sundayMorningReset();
    $('#transbox  input[type=submit]').click(function(evt) {
        $.sundayMorning(
          $('#transbox input[type=text]').val(),
            { source:'', destination:'ZH', menuLeft:evt.pageX, menuTop:evt.pageY},
               function(response) {
                    $('#transbox input[type=text]').val(response.translation);                      
                }
        );

    });             
});

&lt;/script&gt;
</code></pre>

<p>and the form:</p>

<pre><code> &lt;table id="transbox" width="30px" border="0" cellspacing="0" cellpadding="0"&gt;
     &lt;form action="custom-page" method="get" name="form1" target="_blank" id="form1" &gt;
         &lt;tr&gt;
             &lt;td&gt;&lt;input  id="q" name="q" type="text" class="search_input" value="Evening dress" /&gt;&lt;/td&gt;
             &lt;td&gt;&lt;input type="submit" /&gt;&lt;/td&gt;
         &lt;/tr&gt;
     &lt;/form&gt;
 &lt;/table&gt;
</code></pre>

<p>there are another JS called for the script but I don't sure its needed for the question.</p>

<p>thank you.</p>
