Hi All:
I have two questions here, both related to the above topic. For the first one, I have an input field where I only want the user to be able to enter digits 0-9 and a "-" (but that could be left out if necessary). What I'd love is somebody to respond back and tell me that there such a thing as an input field type="number" ... but that ain't gonna happen, is it!! Do basicly I want to use onKeyDown to detect if the keystroke is a digit or a "-", if it is then it's ok to proceeed, but otherwise don't key it.
second question: I have an
in one of my input fields, you can see yourself what it does but I don't want this to be called if the key in question is the tab key. if the user is at the field before this field, and tabs to it because they want to change it, it'll automatically go to the next field because the value length is 4. likewise, if they were to use SHIFT + TAB to tab back to it (because they done a typo) it'd keep giving focus to the nextfield also. The only way they would get around this would be to use the mouse to click in the field. so basicly I need to be able to detect if they used the tab key to get here.
thanks in advance for anybody that can help me
Martin
I have two questions here, both related to the above topic. For the first one, I have an input field where I only want the user to be able to enter digits 0-9 and a "-" (but that could be left out if necessary). What I'd love is somebody to respond back and tell me that there such a thing as an input field type="number" ... but that ain't gonna happen, is it!! Do basicly I want to use onKeyDown to detect if the keystroke is a digit or a "-", if it is then it's ok to proceeed, but otherwise don't key it.
second question: I have an
Code:
onkeyUp="if.this.value.length==4) formname.nextfield.focus()
thanks in advance for anybody that can help me
Martin