Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: trap enter key


Message #1 by "Alex Shiell, ITS, EB, SE" <alex.shiell@s...> on Fri, 7 Feb 2003 16:15:11 -0000
	For existant mail in archive, maybe your mail to web engine could
search for this line in mail header as well as in multi-part MIME 
header :
Content-Transfer-Encoding: quoted-printable
and then replace =3DXX to &#xXX;  This should be enough for Latin-1 
encoded
mails.

	For future mails, you could look at your mail server's capabilities.
Some mail servers can convert quoted-printable mail to 8-bit mail 
before
storing it.

	HTH

> -----Message d'origine-----
> De : P2P [mailto:stephenb@w...]
> Envoy=C3=A9 : jeudi 13 f=C3=A9vrier 2003 11:02
> =C3=80 : javascript
> Objet : [javascript] Re: trap enter key
>
>
> This problem isn't actually our fault as such I would
> emphasise, but we do
> agree we could handle it better.  It does depend on developer
> time becoming
> available, don't hold your breath...
>
> Most mail clients, including Outlook Express, will display
> the messages
> correctly (usually).  It is our web interface that doesn't
> interpret the
> codes.    If this is a problem for you use email or a
> newsreader (point at
> mail.p2p.wrox.com).
>
> The code in Robert Nyman's first post on the website is:
>
> document.onkeydown =3D3D checkKey;
>
> function checkKey(oEvent){
>  var oEvent =3D3D (oEvent)? oEvent : event.
>  if(oEvent.keycode=3D3D=3D3D13) return false;
> }
>
> Using Outlook Express as a newsreader it appears as:
>
> document.onkeydown =3D checkKey;
>
> function checkKey(oEvent){
> var oEvent =3D (oEvent)? oEvent : event.
> if(oEvent.keycode=3D=3D13) return false;
> }
>
> Beware though where (mis)interpreted characters are included
> in replies.
>
> Stephen
>
> <alex.shiell@s...> wrote in message 
news:260850@j...
> >
> > Thanks, it works now
> >
> > I've been on these lists long enough to know the =3D3D problem!! 
;-)
> >
> > Moderator - I know that the 3D problem is caused by
> incompatible character
> > sets, but would it be possible to set up a script that
> scans incoming
> > messages and replaces the '=3D3D' with an '=3D'?  It does cause a 
lot of
> > confusion to newcomers...
> >
> >
> > > First of all, I hope you didn't paste the code in with
> the nasty 3D
> > symbolds that this mail server adds?
> > Also, I misspelled keyCode... (sorry)
> >
> >
> > Anyway, that was just a follow-up to Christine's reply.
> > Best way to do it is like this:
> >
> > function checkKey(oEvent){
> > var oEvent =3D3D (oEvent)? oEvent : event;
> > if(oEvent.keyCode =3D3D=3D3D 13){
> > if(oEvent.stopPropagation) oEvent.stopPropagation();
> > else event.returnValue =3D3D false;
> > }
> > }
> >
> >
> > <form>
> > <input type=3D3D"text" onKeyPress=3D3D"checkKey(event)">
> > <input type=3D3D"submit" value=3D3D"submit">
> > </form>
> >
> >
> > /Robert
> >
> >
> > -----Original Message-----
> > From: alex.shiell@s...
> [mailto:alex.shiell@s...]=3D20
> > Sent: den 12 februari 2003 17:06
> > To: javascript
> > Subject: [javascript] RE: trap enter key
> >
> >
> > Hi Robert,
> >
> > I can't get this to work... it still submits the form when
> I hit enter.
> >
> > If I try alerting the keycode, it just says "undefined".
> >
> > I've also tried putting onkeydown=3D3DcheckKey on the form
> fields, but it=3D20
> > makes no difference.
> >
> > cheers
> >
> > > First, function has to be spelled with a small 'f'.
> > Second of all, that is IE specific code, see below for browsers 
=3D3D
> > supporting standards.
> >
> > document.onkeydown =3D3D3D checkKey;
> >
> > function checkKey(oEvent){
> > var oEvent =3D3D3D (oEvent)? oEvent : event.
> > if(oEvent.keycode=3D3D3D=3D3D3D13) return false;
> > }
> >
> >
> > /Robert
> >
> >
> > -----Original Message-----
> > From: Christine_Sun@c... =3D3D
> > [mailto:Christine_Sun@c...]=3D3D20
> > Sent: den 8 februari 2003 03:05
> > To: javascript
> > Subject: [javascript] RE: trap enter key
> >
> >
> > Sorry, it should be onload
> >
> > -----Original Message-----
> > From: SEAK, Teng-Fong [mailto:tfseak@f...]=3D3D20
> > Sent: Friday, February 07, 2003 11:47 AM
> > To: javascript
> > Subject: [javascript] RE: trap enter key
> >
> > Isn't it onkeydown or onkeysomething instead of onclick?
> >
> > > -----Message d'origine-----
> > > De : Christine_Sun@c...=3D3D20 =3D20
> > >[mailto:Christine_Sun@c...]
> > > Envoy=3D3DE9 : vendredi 7 f=3D3DE9vrier 2003 18:27
> > > =3D3DC0 : javascript
> > > Objet : [javascript] RE: trap enter key
> > >=3D3D20
> > >=3D3D20
> > > <body onClick=3D3D3D"return checkKey();">
> > > ...
> > > Function checkKey()
> > > {
> > > if(event.keycode=3D3D3D=3D3D3D13)
> > > return false;
> > > }
> > >=3D3D20
> > > -----Original Message-----
> > > From: Alex Shiell, ITS, EB, SE [mailto:alex.shiell@s...]
> > > Sent: Friday, February 07, 2003 8:15 AM
> > > To: javascript
> > > Subject: [javascript] trap enter key
> > >=3D3D20
> > > How can I trap the Enter key to stop it from submitting a
> form? =3D3D20
> > > Ideally, is there a way I could make Enter work the same as Tab?
> > >=3D3D20
> > >=3D3D20
> > > to unsubscribe send a blank email to=3D3D20
> > >=3D3D20
> >
> > ---
> > Change your mail options at http://p2p.wrox.com/manager.asp
> or=3D3D20 to
> > unsubscribe send a blank email to
> >
> > ---
> > Change your mail options at http://p2p.wrox.com/manager.asp
> or=3D3D20 to
> > unsubscribe send a blank email to =3D3D
> > ---
> > Change your mail options at http://p2p.wrox.com/manager.asp or=3D20
> >
> >
>
>
>
>

  Return to Index