i wanna enter a value passed by javascript function to the database. is there a way to do that? thanks.
var eng = 0;
var nothome = 0;
var nointerest = 0;
var callback = 0;
var booked = 0;
function myFunction(i,txt, elemid){
var plural;
if (i != 1) plural = "s.";
else plural = ".";
document.getElementById(elemid).innerHTML = txt + i + " time" + plural;
alert(txt + i + " time" + plural);
}
<button onclick="eng += 1; myFunction(eng,'Engaged: ','Engaged');">Engaged</button><span id="Engaged"></span>
<button onclick="nothome += 1; myFunction(nothome,'Not Home: ','nothome');">Not Home</button><div id="nothome"></div>
<button onclick="nointerest += 1; myFunction(nointerest,'No Interest: ','nointerest');">No Interest</button><div id="nointerest"></div>
<button onclick="callback += 1; myFunction(callback,'Call Back: ','callback');">Call Back</button><div id="callback"></div>
<button onclick="booked += 1; myFunction(booked,'Booked: ','booked');">Booked</button><div id="booked"></div>
i wanna insert the value of engaged, booked etc to the database. is there a way to do that? thanks.
what im trying to do here is when i click a button, the corresponding value increments by 1. and then i need to insert this value in the database. if not this way, is there any other way to do this??