$.getJSON data not displaying in loop with ajaxSubmit
<p>I've been having a few issues trying to execute a dynamically loaded form with jquery. Here is my code:</p>

<pre><code>$(this).ajaxSubmit({ 
    url: '/postform1.php',
    type: 'post',
    //target: '#preview',
    success: function(msg) {

        var s = msg + '&lt;form name="sr" id="sr" action="postform.php" method="post"&gt;&lt;input type="text" /&gt;&lt;/form&gt;';
        $('#preview').html(s);

        $.getJSON("/postform1.php", function(data){
        var counter = 0;
        if(data) {
           $.each(data, function(i, val) {
                var newTextBoxDiv = $(document.createElement('div')).attr("id", val);
                newTextBoxDiv.after().html('&lt;label&gt;' + i + ' : &lt;/label&gt;' + '&lt;input type="text" name="' + i + '" id="' + i + '" value="' + val + '" &gt;');
                newTextBoxDiv.appendTo("#sr");
                counter++;
            });
        }
        });
    }
 });
</code></pre>

<p>I was initially echoing the whole form from postform1.php but found the form was not submitting. I dont know if this is the right way of going about it either but figured i'd give it a try. If anyone has any ideas it would be great ro hear from you.</p>
