Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Something looks wrong with your JavaScript code (the jQuery part).. It looks like there is an erroneous closing curly brace <code>}</code> here:</p> <pre><code>$j('#photoimg').live('change', function() { $j("#preview").html(''); $j("#preview").html('&lt;img src="loader.gif" alt="Uploading...."/&gt;'); $j("#imageform").ajaxForm({ target: '#preview' } // &lt;-- right here }).submit(); }); </code></pre> <p>Looks like it should be:</p> <pre><code>$j("#imageform").ajaxForm({ target: '#preview' }).submit(); </code></pre> <p>Anyway, what you're doing by trying to dynamically close that <code>div</code> and inject a new one could be more tricky than its worth. I've never tried to do that but I feel like that would not be cross-browser compatible even <em>if</em> you got it working in, say, Firefox for example. </p> <p>Instead of using <code>$preview</code> as your target, why not wrap it in another <code>div</code> container and use that:</p> <pre><code>&lt;div id="container"&gt; &lt;div id="preview"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>Then, your jQuery would look like this:</p> <pre><code>$j('#photoimg').live('change', function() { $j("#container").html('') .html('&lt;img src="loader.gif" alt="Uploading...."/&gt;'); $j("#imageform").ajaxForm({ target: '#container' }).submit(); }); </code></pre> <p>In which case, the resulting PHP would end up like:</p> <pre><code>echo '&lt;div id="preview"&gt;', "&lt;img src=\"uploads/{$actual_image_name}\" class=\"preview\"&gt;&lt;br /&gt;", '&lt;/div&gt;&lt;div id="preview3"&gt;', 'Line 1 &lt;input type="text" id="cardtext1" name="cardtext1" value="1"/&gt;'; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload