![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello: I'm having a problem with a simple javascript code that checks if the enter key had been pressed or not. The code works propertly in mozilla, but in iexplorer it only works one time, the second one the event isn't throw any more, and I can't catch it. Anyone can help me? this is the sample code function searchIntro(oEvent) { if (oEvento.keyCode) iAscii = oEvent.keyCode; else if (oEvent.which) iAscii = oEvent.which; else return false; if (iAscii == 13) { sendData(); } } input type="text" id ="textBoxName1" name="CCO" size="69" onkeypress="SearchIntro(event)"></tr |
#3
| |||
| |||
|
|
Decide on the name of the function and the variable and use the same names consistently. |
|
Also, the event object does not need to be passed to the function, as it is a global variable. |
|
Try this: |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
On 2005-12-06, Wayne Dobson <nospam (AT) noaddress (DOT) com> wrote: Decide on the name of the function and the variable and use the same names consistently. good advice. Also, the event object does not need to be passed to the function, as it is a global variable. it isn't here. Try this: doesn't work. |
#6
| |||
| |||
|
|
Thanks Wayne The code is well writted, the copy/paste to this window and a small translate has done the rest. The code is case sensitive and the names are correctly referenced. But still the trouble is there : it only works for the first time, in internet explorer. If I don't change the focus to other control, the events don't occurs at this textbox anymore (only the first name). And it only occurs after deleting letters with the backspace key. Any ideas? |
![]() |
| Thread Tools | |
| Display Modes | |
| |