I have null experience in web programming, yet I am testing a simple add on to work with my app. On the webpage I display a number of rows. Each row has an editable field that the user needs to input.
Once he inputs it, I want to launch PHP code to run an SQL statement. My initial try worked, yet the page of the php script was opened. I would like somehow the php to run in the background and the user stays on the same page.
Looking online I found that I need to have something like the following:
<script>
function DataChanged(mId,mQ){
document.getElementById('demo').innerHTML = 'Change Id='+mId+'Q='+mQ ;
$.ajax({
url: 'submitChange.php?Id=5'
});
document.getElementById('demo').innerHTML = 'Arrived here?';
}
</script>
The text field is changed to:
Change Id=...
yet the script isn't running and text isn't becoming
"Arrived here?"
I ran the submitChange.php?Id=5 separately and it worked, so I am guessing my error is from the script above. Any idea what could be wrong?