[imp] Pressing Enter key in To/Cc/Bcc results in sending a mail.

Anant Athavale asa at isac.gov.in
Mon Oct 22 04:50:30 UTC 2007


Dear Harakiri,

Thanks for your inputs.  I will have a look at this.

Regards,
Anant.


----- Message from harakiri_23 at yahoo.com ---------
     Date: Fri, 12 Oct 2007 08:33:39 -0700 (PDT)
     From: Harakiri <harakiri_23 at yahoo.com>
Reply-To: Harakiri <harakiri_23 at yahoo.com>
  Subject: Re: [imp] Pressing Enter key in To/Cc/Bcc results in sending a mail.
       To: imp at lists.horde.org


>
> --- Andrew Morgan <morgan at orst.edu> wrote:
>>
>> Personally, I don't know if there is a way to
>> prevent the web browser from
>> capturing the Enter key and using it to submit the
>> form.  I know that is
>> the default behavior with web forms.
>
> Thats very easy with javascript, just overwrite the
> onkeypress event of the formular fields To, Cc, and
> Bcc, like
>
> window.onload = function ()
> 		{
> 			init();
> 		}
>  function init() {
>
>             document.forms[0].someField.onkeypress =
> submitEnter;
>         }
>
>  function submitEnter(theKey)
>         {
>             var agt =
> navigator.userAgent.toLowerCase();
>             var is_ie = ((agt.indexOf("msie") != -1)
> && (agt.indexOf("opera") == -1));
>
>             if (!is_ie) {
>                 if (theKey.which == "13") return
> false;           } else {
>                 if (window.event.keyCode == "13")
> return false;            }
>         }
>
>
>
> ____________________________________________________________________________________
> Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's   
> updated for today's economy) at Yahoo! Games.
> http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow
> --
> IMP mailing list - Join the hunt: http://horde.org/bounties/#imp
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: imp-unsubscribe at lists.horde.org
>


----- End message from harakiri_23 at yahoo.com -----



Regards,

Anant Athavale.


More information about the imp mailing list