currently working on a new project and i've hit a little ditch...
Basically, I'm trying to execute a php script after an ONCHANGE call from a text box, and then post that data with a Javascript function that dynamically posts the data...
In other words, take the following example into mind :
Code: Select all
Price<div id="counter">Your text will appear here</DIV>
<form method="post">
<input TYPE="text" value="some text" name="divValue" id="divValue" size="20" onchange="updateMessage()">
</form>
<script language="JavaScript">
<!--
function updateMessage()
{
var x = document.getElementById("divValue").value;
document.getElementById("counter").childNodesї0].nodeValue = x;
}
// -->
</script>With that in mind, here lies my problem :
what i'm wanting to do is when I (or a user) tabs out of this box, the action should be that a function is called from php (in this case, it would be a query function to see if the item exists in the databse). when the item is found, it should then run the little updateMessage function and post whatever field it is i found in sql.
is this possible? if so, could anyone point me in the right direction as to how to figure this one out? it's busting my brain cells and i guess i'm just not able to find the correct search string to type in google to get any kind of results for this subject.
Thanks in advance.