There are two buttons in my code:
The button on the right triggers a function called update()
:
<script>
function update(buttonid){
document.getElementById(buttonid).disabled = true;
event.stopPropagation();
var textboxid = buttonid.slice(0, -2);
var id= textboxid.substr(0, textboxid.indexOf('_'));
var columnid= textboxid.substr(textboxid.indexOf('_')+1, textboxid.length);
var value=document.getElementById(textboxid).value;
var str=textboxid+"_"+value;
if (window.XMLHttpRequest) {
// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
} else {
// code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","ListaRyF/Update?q="+str,true);
xmlhttp.send();
}
</script>
The button on the left calls an empty function named 'row_update()'.
The issue here is that when I click the left button, it also activates the function of the right button.
The HTML code for the buttons is as follows:
Left Button:
<button class="btn btn-default" id="row_1" onclick="row_update('1_9');">
<i class="fa fa-save fa-fw button-row"></i>
</button>
Right Button:
<button class="btn btn-default" id="1_2_b" onclick="update('1_2_b');">
<i class="fa fa-save fa-fw"></i>
</button>
Can anyone help me with resolving this issue?
Thank you!