Submitting a form in a div within a div
<p>I have a page that contains a div. I load another page in to that via various links on my page. One of these pages that loads in to the div has a form on it, and that form submits data to a PHP page and updates a div within that page.</p>

<p>So the strcture is:</p>

<p>Main Page<br />
-Main page DIV<br />
--Internal page<br />
---Form<br />
---Internal page DIV<br />
----Submitted data should be shown here<br />
---/Internal page DIV<br />
--/Internal page<br />
-/Main page DIV<br />
/Main page<br /></p>

<p>(I hope that makes some sense).</p>

<p>In my main page I have the following code:</p>

<pre><code>$(document).ready(function()
{

$('#create').submit(function() {

$.ajax(
    {

    data: $(this).serialize(),

    type: $(this).attr('method'),

    url: $(this).attr('action'),

    success: function(response)
        { // on success..

        $('#created').html(response);

        }

    });

return false;
});

$("#content").load("content.html");

});
</code></pre>

<p>Then within the internal page that is loaded in to the DIV I have the following:</p>

<pre><code>&lt;form id="create" method="POST" action="create.php"&gt;
&lt;input type="text" name="url"&gt;
&lt;input type="submit" value="Create" /&gt; 

&lt;div id="created"&gt;&lt;/div&gt;
</code></pre>

<p>However all that happens is that the create.php page loads in the main window, rather than within the div "created".</p>

<p>This works if it is on just one page, so I assume it's something to do with including one div inside another. Can anyone help?</p>

<p>Thanks</p>
