Trigger jQuery function after submit 
<p>I need to trigger a function after the submit function has been executed. In the first PHP file I choose an image, after this it calls the second file which echos the image and some input elements after the upload. At this point I also want a colopicker. The code I'm using I found <a href="http://laktek.com/samples/color_picker/demo.html" rel="nofollow">here</a>. The code in the first file is:</p>

<pre><code>&lt;script type="text/javascript" &gt;
    $(document).ready(function() {      
        $('#photoimg').live('change', function() { 
            $("#preview").html('');
            $("#preview").html('&lt;img src="loader.gif" alt="Uploading...."/&gt;');
            $("#imageform").ajaxForm({
                target: '#preview'
            }).submit();
            $('#color1').colorPicker();
        });
    }); 
&lt;/script&gt;
</code></pre>

<p>The file which is called echos then the image, which is showed in the first file in the div element "preview".</p>

<pre><code>echo "&lt;img src='uploads/".$actual_image_name."'  class='preview'&gt;&lt;br  /&gt;";
echo "&lt;input id='color1' type='text' name='color1' value='#333399' /&gt;;
</code></pre>

<p>At the moment it calles the colorpicker function before the elements are echoed.how can i let it run after it is all echoed? Thanks for any help!</p>
