|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
capturing the backspace key
Good day.
We have a report page that creates a report on data about a specific month by selecting the month on a drop-down menu. My problem is that if I pressed the backspace key, the data inside tables will be reset to the month set before. but the drop-down menu stays the same. Is there a way for me to CAPTURE THE BACKSPACE KEY WHEN PRESSED, so that I can store it in a variable and do some conditionals... Thanks very much |
|
#2
|
||||
|
||||
|
If you use the javascript event onKeydown you can then send it to a function which can test to see if the key was the backspace or not. You must pass the event that trigered the call.
onKeydown = checkKey(event); something like this Code:
function checkKey(evt) {
function whatKey(evt) {
evt = (evt) ? evt : ((window.event) ? event : null )
if (evt) {
if ( evt.keyCode == 8) {
alert("The backspace key was hit.")
}
}
}
|
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > capturing the backspace key |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|