Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: Re: "object expected" error


Message #1 by "Pawan Gupta" <pawan.gupta@i...> on Fri, 1 Nov 2002 12:56:17 +0530
This is a multi-part message in MIME format.

------=_NextPart_000_0026_01C28254.7FC6E480
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

THANKS PONNA REDDY

THIS CODE IS VERY USEFUL TO ME

PAWAN
  ----- Original Message -----
  From: Ponna reddy
  To: JavaScript HowTo
  Sent: Monday, April 01, 2002 6:10 PM
  Subject: [javascript_howto] Re: "object expected" error


  Hi Pawan,



   You can trap any key by using the KeyDown Event. The following 
Example may help you.

  
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

  <head>

  <script language=3D'javascript'>

   function Trap_Key () {

        var key =3D window.event.keyCode;

       alert(key); file://this will display the Ascii Value of the key.

  }
  </script>

  </head>

  <body>

   <center><h2>Key Trap Example </h2></center><br>

  <input type=3D'text' name=3D'txtKey' onKeyDown=3D'Trap_Key()'>

  </body>

  
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

  Wish you all the best.......

  Have a good day............................

  Thanks & Best Regards,

   Veera R Ponna

  There is never enough time, unless you're serving it.

  
-------------------------------------------------------------------------
--------------------


  
  >hi to all
  >
  >how i can trap the key whenever i press a or A or t etc
  >
  >thanks in advance
  >
  >pawan
  >
  >
  >
  >---
  >
  >Improve your web design skills with these new books from Glasshaus.
  >
  >Usable Web Menus
  
>http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogram
me
  >r-20
  >Constructing Accessible Web Sites
  
>http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogram
me
  >r-20
  >Practical JavaScript for the Usable Web
  
>http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogram
me
  >r-20
  >
  >


-------------------------------------------------------------------------
-----
  MSN Photos is the easiest way to share and print your photos: Click 
Here
  --- Improve your web design skills with these new books from 
Glasshaus. Usable Web Menus 
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e r-20 Constructing Accessible Web Sites 
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e r-20 Practical JavaScript for the Usable Web 
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e r-20 ---




  Return to Index