JavaScript function
function sub()
{
var url = "showpdf.php";
$.ajax({
type: "post",
url: url,
success: function(response)
{
document.getElementById("alldata").innerHTML = response;
}
});
}
I am calling this function in html like this:
<input type = "button" value="Go" onclick="sub()">
in showpdf.php file I write bellow code to get form data
$academic = $_POST['academic'];
$uni = $_POST['University'];
but I am getting this error
Undefined index: academic
You should get the data from the input fields and send through the ajax post call