Catp00p Posted September 12, 2009 Share Posted September 12, 2009 I am using ajax to update a div on my page. The form to call the ajax script: <form name='updateTrainForm' method='post' onsubmit='return false;'><input type='hidden' name='skill_id' value='$skill_id'><button type='submit' class='train' onclick='doTrainUpdate();'>Train Now</button></form> The Ajax: function doTrainUpdate() { var xmlHttp = getXMLHttp(); xmlHttp.onreadystatechange = function() { if(xmlHttp.readyState == 4) { HandleResponse(xmlHttp.responseText); } } xmlHttp.open("POST", "train.php", true); xmlHttp.setRequestHeader("cache-control", "no-cache"); xmlHttp.send(null); } function HandleResponse(response) { document.getElementById('trainUpdate').innerHTML = response; } In train.php, the value is not passed. $skill_id = $_POST["skill_id"]; I'm guessing i have to somehow pass the values through the js, but I don't know java at all. Any pointers? Link to comment https://forums.phpfreaks.com/topic/174017-trouble-getting-values-passed/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.