I am using specially styled input elements which cannot actually use input tags, so instead I am building and submitting a form via Javascript like this answer describes.
In short:
var form = document.createElement("form");
var hiddenField = document.createElement("input");
hiddenField.setAttribute("type", "hidden");
hiddenField.setAttribute("name", "id["+index+"]");
hiddenField.setAttribute("value", this.id);
form.submit();
Now as far as I know, in my MVC controller I have to retrieve the data like so:
public ActionResult Submit(string a = null, string b = null...)
{
//something
}
My issue with this is that the data I am submitting with this form is very simple and is ONLY a list of variable length of unknown numbers that serve as IDs to fields. For example:
[1,2,5,3,10,199999]
and I have no idea of the range or amount of these IDs.
How can I send this data back to my MVC page controller?
EDIT: The currently selected answer does indeed answer the question as I asked it. I didn't get the chance to test this till now but there is no support for FormData in IE9. Is there any fallback I can use to get the same result in IE9?