Update function.
Update function.
Hi everybody,
I need your help to solve a problem : when I run a page of my site , the system automatically performs a js function that I should not . This function is used to update student grades : when the teacher types the
student grades , the function updates the db . I do not want this function is automatically executed when the page loads .
this is the js function:
function cambiaProposta(arg1, arg2, arg3, arg4, arg5, arg6, event) {
var request;
request = new XMLHttpRequest();
request.open("GET", "salvaProposta.php?&a="+arg1+"&b="+arg2+"&c="+arg3+"&d="+arg4, true);
request.onreadystatechange = function() {
if(request.readyState == 4) {
var response = request.responseText;
document.getElementById('finale').innerHTML = response;
$("#votoa1"+arg5).val(arg4);
if ($("#votoa1"+arg5).val() < 6)
{
$("#votoa1"+arg5).css('color', 'red');
}else{
$("#votoa1"+arg5).css('color', 'black');
}
}
}
request.send(null);
}
</script>
Thanks in advance
Tegatti