homerUK
10-30-2006, 06:03 PM
Hi Guys,
I'm trying to capture a keypress, and in particular looking for the cursor up and cursor down key stroke.
I have a hyperlink (with a value of 0) and when the user clicks on it, they should be able to navigate the value up and down using the cursor keys. here's what I have so far
function eg3(ctrl) {
var current = ctrl.innerHTML;
var new_figure = (parseFloat(current) + 1);
ctrl.innerHTML = new_figure;
}
<a href="#" id="eg3_1" onKeyDown="return eg3(this)">0</a>
it works ok in that when the user clicks it, you can press any key and it increments by one. I need to capture the cursor up and down keys though.
any ideas?! I'm lost!!
I'm trying to capture a keypress, and in particular looking for the cursor up and cursor down key stroke.
I have a hyperlink (with a value of 0) and when the user clicks on it, they should be able to navigate the value up and down using the cursor keys. here's what I have so far
function eg3(ctrl) {
var current = ctrl.innerHTML;
var new_figure = (parseFloat(current) + 1);
ctrl.innerHTML = new_figure;
}
<a href="#" id="eg3_1" onKeyDown="return eg3(this)">0</a>
it works ok in that when the user clicks it, you can press any key and it increments by one. I need to capture the cursor up and down keys though.
any ideas?! I'm lost!!