I have a form inside another form element but when I try to serialize the nested form the function just returns an empty object. I ask this because I'm coding a Wordpress plugin and I need a form in the post editor page and everything I put in the page seems to be added inside a parent form, so here is an exmaple of what I want:
<form>
<div>Other content goes here...</div>
<form id="otroform"><input type="text" value="meine valor" name="variable"/></form>
</form>
This is the JS code
var formData = jQuery('#otroform').serializeArray();
console.log(formData);
Returns:
[]
If I remove the parent form then it will work normally.
Thanks in advance.