Networking | Hardware | Software | Multimedia | System | Unix&Linux | MBA

Home>>Hardware>>Help with keystroke

Help with keystroke

pyrotaz
11-23-2004, 06:06 PM
I'm working on a project in Javascript. I'm making a shopping cart and I want the user to be able to mouseover the picture and then press A to add it to the cart. I think I have the onmouseover part right. But, when I mouseover and hit A nothing happens so I type Javascript into the Netscape bar and it says "Error: top.HIDDEN.keyPressed is not a function"


I have attached a zip file with all the files the start file is Friendlyant.html.
Any help would be great!!

pyrotaz
11-23-2004, 09:44 PM
This is an example of where I'm stuck.


<TD>WWI Drager Bubikopf Diving Helmet VERY RARE <BR>
<a href"#"><image src="helmet.jpg"onMouseover="setItems('Diving Helmet WWI Drager', 4000)";onMouseout="resetItems"></a>
</TD>
<TD>$4000</TD>

I have an image and when I place the mouse over it, its selected. I want to be able to press the A or a and have it add that item two the shopping cart.

bnovc
11-23-2004, 09:48 PM
I would use accesskey='a' on an input box.

pyrotaz
11-23-2004, 10:01 PM
I'm not sure what you mean could you give me an example?

glenngv
11-24-2004, 05:29 AM
Javascript is case-sensitive, so keyPressed is differrent with keypressed.

pyrotaz
11-24-2004, 01:48 PM
I made some corrections on the script and now the error says that in line 130

key has no properties. I included the new script in a zip file. Thanks for all who have helped so far. This one is really stumping me big time. I'm about ready to give up. :(


 

TOP

For more info

setting a minimum size
Auto Preview of Image 
Refresh with a query s
JS Validation obsolete
Javascript Pop up func
Slide show transitions
I'm a newbie...please!
how to write coding in
Advanced Debug Info 
.js file doesn't work 

News Archive

Adding Graphic To Text
re-direct form after s
pop up window controls
Clock on homepage - He
passing a param from a
Password Procection wi
document.title in same
focus onload 
Counting Wrong from Ri
Help needed on how to 

Related stories:

Copy link text to clipboard
Problem with htmlarea
Random URL script help needed
possible to pass a form field name to a function, like this.value?
web forms proxy servers
List/menu link values
Need HELP on combo boxes

Copyright@2004-2005 www.zzcoke.com All Right Reserved

advanced web statistics