I am making a page to validate an item but I would like this page to only close if the scanned item is right until it works, but can not find any code to hide or block the buttons in the title bar of the browser windows because I would like the user could not close the window someone knows a formula to do this in some web language.
<script>
function valid(){
var grupo = $("#grupo").val();
var certo = $("#certo").val();
var familia = $("#familia").val();
if(window.event.keyCode == 13){
if(grupo != certo){
document.getElementById('fail').style.display = "block";
$("#grupo").val('');
}else if(familia == 'T46S' || familia == 'T470' || familia == 'T480'){
document.getElementById('kit').style.display = "block";
document.getElementById('kit2').style.display = "block";
$("#kit2").focus();
document.getElementById('grupo').style.display = "none";
}else{
window.open('', '_self', '');
window.close();
}
}
}
</script>