TestTabbingIssue
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.1.1/jquery-confirm.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.1.1/jquery-confirm.min.js"></script>
<input id="enterhere" type="text" placeholder="Tab from here for message" />
<input id="arrivehere" type="text" placeholder="then arrive here" />
<input id="buttonalert" type="button" onclick="testAlert()" title="Click to alert" value="Alert" />
JavaScript
window.testAlert = function(){
$.alert({
title: 'Alert!',
content: 'Shows a simple alert!',
boxwidth: '150px',
useBootstrap: false,
});
};
$("#enterhere").on('keydown', function (e) {
var key = e.which || e.keyCode;
if (key == 9) { //Tab key
$.confirm({
title: 'Test confirm',
content: 'A nice simple message.',
boxWidth: '30%',
buttons: {
formSubmit: {
text: 'Confirm',
keys: 'enter',
btnClass: 'btn-blue',
action: function () {
$("#arrivehere").focus();
}
},
cancel: function () {
}
},
useBootstrap: false
});
return false;
}
});