i have a button in my table , original is using GET to send some variable to the new page user.php , but I don't want to show these information in url . I try to built a form and submitted it to the other user.php, but user.php get nothing:
$('table').on( 'click', 'td .btn-info', function () {
var parent = $(this).closest('table').parents('tr').prev();
var parentIndex = parent.find('.index').text();
var currentIndex = $(this).closest('tr').index();
var data = sections[parentIndex][currentIndex];
var mapForm = document.createElement("form");
mapForm.target = "Map";
mapForm.method = "POST"; // or "post" if appropriate
mapForm.action = "user.php";
var name= document.createElement("input");
name.type = "hidden";
name.id = "name";
name.value = data.name;
mapForm.appendChild(name);
var loc= document.createElement("input");
loc.type = "hidden";
loc.id = "loc";
loc.value = data.loc;
mapForm.appendChild(loc);
document.body.appendChild(mapForm );
map=window.open("", "Map", "height=500,width=800,scrollbars=yes, resizable=yes");
if (map) {
mapForm.submit();
} else {
alert('You must allow popups for this map to work.');
}
} );