| re: onkeypress, enter and iexplorer
Thanks evertjan, but the trouble's still here : I made a mistakes
copying function to this message :-), but the case sensitive is
correctly implemented.
It only works the first time, the second one, on Internet Explorer,
fails and doesn't capture any other onkeypress event.Mozilla runs fine
the code everytime I use it.
whats happening?
Juan
Evertjan. ha escrito:
[color=blue]
> Juan wrote on 05 dec 2005 in comp.lang.javascript:
>[color=green]
> > Anyone can help me?
> >
> > this is the sample code
> >
> > function searchIntro(oEvent)[/color]
>
> should be: SearchIntro(oEvent)
> case sensitive!!
>[color=green]
> > {
> > if (oEvento.keyCode)[/color]
>
> should be: oEvent.keyCode
>[color=green]
> > iAscii = oEvent.keyCode;
> > else if (oEvent.which)
> > iAscii = oEvent.which;
> > else
> > return false;[/color]
>
> a return value is not used by onkeypress
>[color=green]
> > if (iAscii == 13)
> > {
> > sendData();
> > }
> >}
> >
> > <input type="text" id ="textBoxName1" name="CCO" size="69"
> > onkeypress="SearchIntro(event)"></tr>[/color]
>
> A shorter version of your function is:
>
> function SearchIntro(oEvent){
> if ((oEvent.keyCode && oEvent.keyCode==13)
> || (oEvent.which && oEvent.which==13)) {
> sendData();
> }
>
> --
> Evertjan.
> The Netherlands.
> (Replace all crosses with dots in my emailaddress)[/color] |