var generateHideElement = function (name, value) { var tempInput = document.createElement("input"); tempInput.type = "hidden"; tempInput.name = name; tempInput.value = value; return tempInput; } var form = document.createElement("form"); document.body.appendChild(form); var jData = generateHideElement("jData", jsondata), jsongroups = generateHideElement("jsongroups", jsongroups), cacheKey = generateHideElement("cacheKey", "SalaryCalculation"), execlName = generateHideElement("execlName", selector.$orgName().val()); form.appendChild(jData); form.appendChild(jsongroups); form.appendChild(cacheKey); form.appendChild(execlName); form.method = "post"; form.action = $.action.url("ImportExcel1", null, "CommonInfo", "CommonX6Api"); form.submit();