I have a form that embeds another form:
<form>
<input type="text" name="main[name]">
<textarea name="main[body]"></textarea>
<div id="embedded">
<input type="text" name="main[embedded][name]">
<textarea name="main[embedded][body]"></textarea>
</div>
</form>
I need to serialize the embedded form only.
$('#embedded').serialize() results in empty string.
You are not embedding another form, you are embedding a
div.The
serialize()method can only be called on aformelements, or theformelement itself.