Okay this is strange. I'm new to AJAX and I'm trying to use it with php to check a variable from my database before a form is submitted.
It works almost fine. The strange part is that it seems to be saving anything I enter into the text field.
var urlName = $("#url").val();
So we get the var from the text box and hand it over to ajax
$.ajax({
type: "POST",
url: "check.php",
data: "url="+ urlName+"&pageid="+ pageid,
Now in check.php I have it echoing $_POST["url"] and then I have the ajax script alerting the msg just to troubleshoot.
If I enter box, it alerts box to me. If I erase box and enter ajax, for example, it will alert box and then alert ajax. If I erase ajax and enter something else it will then alert me each previous attempt...
if $_POST["url"] == the data in the text box then I have no idea why it's caching everything else. Thoughts?