Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

KEYCODE CHECK ON FRAMELEVEL 1

Status
Not open for further replies.

ThorO

Programmer
Sep 28, 2002
20
NO
Hello guys

I have a frameset within a .HTA document where I want to stop users from certain keys as e.g. F5. I have created a script within the FORM, but since I have a lot of forms I am hoping to set this up on the Framelevel (globally) and make it work for all forms. I see that onkeypress,down,release does not work for frame, but maybe there is possible to have a script working globally?

my script looks like this:
Code:
function keychk() {
if ( (event.altKey) || (event.keyCode == 9) )return true;
if (event.keyCode == 9) return true;
if (event.keyCode == 116) return false;
if (event.keyCode == 117) return false;
if (event.keyCode == 121) return false;
return true;
}
and works great within a form.

Thanks in advance
Thor
 
You'll have to attach the handlers at very least to each document. If you want to avoid duplicating the handler code, you can have them stored in the frameset page, and assign the handlers in each frame to "parent.functionname".

Hope this helps,
Dan



[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Thanks for quick and good reply... got it to work and now I only need one line in each form, meaning less code and faster response

Thanks again:)

Thor
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top