2
I am making a page to validate an item but I would like this page to only close if the scanned item has right up to there works, however can not find any code to hide or lock the buttons of the title bar of the windows of the browsers because I wish 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>
you can’t prevent all user actions, and wouldn’t recommend it, I bet you wouldn’t like it if a site hides the buttons on your browser’s toolbar :) , just to illustrate,
xml
is not a language, so it has no commands or actions, the actions to intervene in the user’s browser are made withJavascript
– Ricardo Pontual