![]() |
problems with FF and Chrome disabling F5
to disable f5 I use this code:
<% brow=Request.ServerVariables("http_user_agent") if instr(brow,"MSIE")>0 then tk="MS" else tk="FF" end if got=tk+"cancelRefresh()" %> <html> <head> <title>test</title> <script language="JavaScript"> function MScancelRefresh(){ if (document.all){ if (event.keyCode == 116){ alert('[F5] disabled!'); { event.keyCode = 0; event.returnValue = false; event.cancelBubble = true; return false; } } } } function FFcancelRefresh(who) { function __keyPress(evt) { var result = true; if(evt.which == 116) alert('[F5] disabled!'); result = false; return result; }; if(!who) who = window; if(who.document && who.document.captureEvents) { who.document.captureEvents(Event.KEYDOWN); who.document.onkeydown = __keyPress; }; } </script> </head> <body onkeydown="<%=got%>"> ... ... ... </body> </html> it run perfectly in IE FF and Chrome the problem is when I insert in the body a form with input like <form action="newfolder.asp" > <input type="text" name="newdir" value="new folder" size="15"> <button type="submit">go</button> in IE it run perfectly in FF and Chrome is impossible insert a new folder in input how is possible? |
Quote:
|
thank you 100 times to perfect analysis :thumbsup:
|
| All times are GMT +1. The time now is 03:17 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.