I’m populating a form in Javascript before sending it off, and thus need to post the form with javascript:
var url = "http://urltomyaction";
var myvar = "somedata";
var = oFormObject = document.forms['fileselectform'];
oFormObject.elements['myvar'].value = myvar;
oFormObject.action = url;
oFormObject.submit();
My issue is that I need to put the parameters in a POST, instead of encoding them in the URL, but this method results in a GET with the form parameters in the URL. What am I missing? How can I specify to POST?
You set its
methodattribute to'POST', either in HTML:or in JavaScript: