problem with jquery
<p>I am using jQuery to upload an image and show a live preview. I have a form with id <code>prescriptionform</code>, file input with id <code>scaninput1</code> and <code>&lt;div&gt;</code> for preview with id <code>preview</code>.</p>

<p>jQuery code:</p>

<pre><code>$('#scaninput1').live('change', function() { 
    $("#preview").html('');
    $("#preview").html('&lt;img src="scripts/loader.gif" alt="Uploading...."/&gt;');
    $("#prescriptionform").ajaxForm({
        //alert("Hiiiiiii");
        target: '#preview'
    }).submit();
});
</code></pre>

<p>Code is running and I am uploading the image, but it's not submitting to <code>ajaximage.php</code>.</p>

<p>My HTML code:</p>

<pre class="lang-html prettyprint-override"><code>&lt;form name='prescriptionform' id="prescriptionform"  method='post'  enctype="multipart/form-data" action='ajaximage.php'&gt;
    &lt;div id="preview"&gt;&lt;/div&gt;
    &lt;input type="file" id="scaninput1" /&gt;
&lt;/form&gt;
</code></pre>
