EDIT: there are one conceptual error and one technical error on the problem definition so this question should better be closed instead of sanitized. When I have time to redefine the problem I'll post it again. Please help voting to close because of unspecific.
There are lots of info and questions about serializing complex HTML forms to its corresponding JavaScript object (for example this).
Here is a sample of that process: having this form
<form>
<input type="text" name="scalar" value="1">
<input type="text" name="array[0]" value="1">
<input type="text" name="array[1]" value="2">
<input type="text" name="array[2]" value="3">
<input type="text" name="object[subscalar]" value="1">
</form>
And getting from it this javascript object
{
"scalar": 1,
"array": [1, 2, 3],
"object": {
"subscalar": 1
}
}
But how can I do the inverse job?
Our goal is to perform a native POST targeting a separate browser window. We have a complex JavaScript object and we were sending through an AJAX POST, so we were using the object directly as jQuery.ajax data parameter. But now we need to create a real form in the DOM containing the inputs and values with all that brackets syntax, and then natively submit it targeting a specific frame.
jQuery usage is optional. Already existing method, library, etc is preferable against a custom snuppet. This isn't about not being able to code it, it's about not being sure we need to reinvent the wheel.
Thanks in advance.