I know that function will need to call out by using onclick or any events. But is it possible to get a hidden value without user handling.
Sample Form:
$ID = 3;
$Report1 = "Test1.docx";
<form id = "Test" action="Nextpage.php">
//Not sure how to call out my function over here...
<input type="hidden" id="ID" name="ID" value="<?php echo $ID ?>"/>
<input type="hidden" id="ReportPath" name="ReportPath" value="<?php echo $ReportPath ?>"/>
//Once user click, function of RemoveDoc() will handle it.
<input type="submit" id="Remove" name="<?php echo $Report1?>" value="Remove" title="Remove report1" onclick="return RemoveDoc(this.name, this.getAttribute('Report1'));" />
My function:
function Remove(ID, ReportPath, Report1)
{
xmlhttp1=new XMLHttpRequest();
xmlhttp1.open("GET","functions/call.php?ID="+ID+"&ReportPath="+ReportPath+"&Report1="+Report1,true);
xmlhttp1.onreadystatechange=function()
{
if (xmlhttp1.readyState==4 && xmlhttp1.status==200)
{
document.getElementById("msg").innerHTML= xmlhttp1.responseText;
}
}
xmlhttp1.send();
return false;
}
So how can i pass in the hidden value of the input into my function Remove(ID,ReportPath...) since it's now hidden and no action taken. Kindly advise.