SofToGo Products Forum Index SofToGo Products
Forum About SofToGo Products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Prevent backspace going back a page

 
Post new topic   Reply to topic    SofToGo Products Forum Index -> FlexBrowser
View previous topic :: View next topic  
Author Message
nmasna



Joined: 04 Apr 2007
Posts: 37
Location: Cerrito 228 - 4 - B - BsAs - Argentina

PostPosted: Wed Feb 10, 2010 1:31 pm    Post subject: Prevent backspace going back a page Reply with quote

Please can you explain how I can prevent the user from pressing the backspace key and going back a page but still allow the key to be used to delete text when the focus is in a text box.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
nmasna



Joined: 04 Apr 2007
Posts: 37
Location: Cerrito 228 - 4 - B - BsAs - Argentina

PostPosted: Wed Feb 10, 2010 1:40 pm    Post subject: Reply with quote

On FlexBrowser, Backspace is a key that works differently than others like Control+P (print) or Control+L (open file). So configuring it as one of KeyBoard/IgnoreKey doesn't always work. As a turnaround please manage it via the HTML code as shown in the following example

Code:
<HTML>

<HEAD>
<TITLE>FlexBrowser example on Backspace</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META NAME="MobileOptimized" content="240">

<script type="text/javascript">
   var inform=false;
   function FlexKeyHandler()
   {
      if (inform) return true;
     
      if (window.event && window.event.keyCode == 8)
      {
         // try to cancel the backspace
         window.event.cancelBubble = true;
         window.event.returnValue = false;
         return false;
      }
   }

   document.onkeydown = FlexKeyHandler;
</script>

</HEAD>

<BODY>
<P>
On your form fields you will to add <br/>
onfocus="inform=true" onblur="inform=false";

<FORM NAME="BackspaceSample" ACTION="SomeScript.py">
<form>
   <input type="text" name="txtENTER" VALUE="" onfocus="inform=true" onblur="inform=false">
   <input type="submit" NAME="Ok">
</form>
   
</FORM>
</P>
</BODY>
</HTML>
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    SofToGo Products Forum Index -> FlexBrowser All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group - Hosting by Towebs