In the following test of a concept (do nothing) script:
Clicking on the checkbox displays the table.
Clicking on a table value, changes the textbox and hides the table.
I want to be able to hide the table again without changing the text box contents by pressing the ‘escape’ key.
Is there a way to do this?
[code]
<html>
<head>
<title>Escape logic</title>
<script type=”text/javascript”>
function Show(msg) {
document.getElementById(‘_info’).style.display = ‘none’;
document.getElementById(‘ckBox’).checked = false;
// Looking for test here to NOT write to textbox if ‘Escape’ has been pressed
// if (??? != ESC) {
document.getElementById(‘info’).value = msg;
// }
}
</script>
</head>
<body>
<input type=”text” id=”info” value=”Something Brilliant!”>
<input type=”checkbox” id=”ckBox”
onclick=”if(this.checked==true){document.getElementById(‘_info’).style.display=’block’}”>
<span id=”_info” style=”display:none”>
<table border=”1″><tr>
<td><span onclick=”Show(‘Home’)”>Home</span></td>
<td><span onclick=”Show(‘Up’)”>Up</span></td>
<td><span onclick=”Show(‘PgUp’)”>PgUp</span></td>
</tr><tr>
<td><span onclick=”Show(‘Prev’)”>Prev</span></td>
<td><span onclick=”Show(‘Now’)”>Now</span></td>
<td><span onclick=”Show(‘Next’)”>Next</span></td>
</tr><tr>
<td><span onclick=”Show(‘End’)”>End</span></td>
<td><span onclick=”Show(‘Down’)”>Down</span></td>
<td><span onclick=”Show(‘PgDn’)”>PgDn</span></td>
</tr></table>
</span>
</body>
</html>