10 Replies Latest reply on Oct 11, 2013 9:58 AM by steve_ssh

    Trapping the Backspace Key

    bartman352004

      Does anyone know of or have code specific to Filemaker IWP that will trap the Backspace key in IE or Firefox? As we all know the Backspace key in IE functions the same as the Back button when none of the forms fields have focus. Anyone have a work around for IE on this?

        • 1. Re: Trapping the Backspace Key
          Nerico

          I'm surprised no one has responded to this post.  I just found out that this is an issue after spending a lot of time preparing an IWP solution.  This is big enough to make my solution useless!!!!

           

          Anyone have any sugeestiong on how to handle this? 

          • 2. Re: Trapping the Backspace Key
            DavidZakary

            If I had to guess, you likely can't easily trap for a key in IWP. You're under the browser's control, not FileMaker's at this point. FileMaker isn't going to do anything until the current action is submitted back to the server.

             

            I'd love to be proven wrong by somebody.

            • 3. Re: Trapping the Backspace Key
              Nerico

              Sadly, you are right.  Living in the Mac bubble, I had not encountered this issue.  But just a little bit of googling this afternoon has shown me that this a longstanding issue with browser "functionality" that seems to have been (understandably) enraging users for years.

               

              However, since we can't prevent people from hitting the backspace key, I would like suggestions on how to minimize impact.  I'm trying to use script triggers to return users to the proper record/layout but I don't know if they are not working because they are not IWP compatible or because the way that the wrong record is getting "navigated" to is not allowing them to be triggered.

               

              My first stab was to create a global variable that would keep track of the record that I purposely navigated to and then set up an "on record load" script trigger that would compare the record ID to the global variable and return me to the correct record if the ID's didn't match.  The script does not seem to get triggered. 

               

              Any ideas?

              • 4. Re: Trapping the Backspace Key
                steve_ssh

                Hi Nerico and David,

                 

                I'd like to take a stab at creating a workaround for this.  I've got to get away from my machine for a while to get some fresh air, but hopefully tonight I'll have some time to see if I can cook something up to disable the delete key ==> back behavior in the browser.

                 

                Question:

                 

                    In your IWP interface, do you have the FM Toolbar showing up at top, or are you hiding it?

                 

                Kind regards,

                 

                -steve

                • 5. Re: Trapping the Backspace Key
                  Nerico

                  Hidden and locked

                  • 6. Re: Trapping the Backspace Key
                    steve_ssh

                    Hi Nerico,

                     

                    I have a workaround to offer.

                     

                     

                    The Particulars:

                     

                    1)  The workaround uses Javascript to trap for the delete key in the IWP page -- if the user is not inside a text field, the delete key action will be suppressed.  This helps out a lot with the unwanted back-navigation issue.

                     

                    2)  The workaround is intended for the case where the FM toolbar has been hidden and made inaccessible.  It is probably doable to make a more sophisticated version of the workaround to also cover the toolbar, but I haven't worked that out.  (There is a twist to the toolbar scenario which makes things considerably more tricky than the non-toolbar case.)

                     

                    3)  In doing testing this evening, I've noted that Opera is the only browser where it is still moderately easy to get into one particular window state where the back navigation is still triggered.  If this is really important, I can spend some more time on the Opera case to see what I can do, but I've noticed that most folks care very little if Opera is the only outlying case.  With the remaining browsers that I tried (Safari, FireFox, IE, Chrome) it is probably still possible to focus the window in a way where the back navigation could still be triggered, but I was not able to make this happen during my testing.

                     

                     

                     

                    Attached to This Post:

                     

                    The workaround actually has two variations.  To keep things simple, I will attach a sample of the variation which I believe is easier to implement.  If anyone seems to want the other variation I can post it as well.

                     

                    The workaround is illustrated with a sample file.  The sample file contains an unmodified layout which illustrates the undesirable behavior (which, per my observation, is not just limited to IE and FireFox).  There is also a modified layout, which illustrates the workaround in action.

                     

                     

                     

                    My Suggestions:

                     

                      - Download and host the sample file (hosting via either FMS or FMP/FMPA should work fine).

                     

                      - Try it out and see if it performs as desired, and see if it makes sense.

                     

                      - If you like the approach and what it accomplishes, then try it out in all browsers that you need to target.

                     

                      - Let me know if you have any questions -- about how it works, or how to integrate it, or anything else related.

                     

                     

                    Lastly:

                     

                    No offense taken from my end if this is not the type of workaround that you were hoping for.  I can imagine a few different reasons why this might be undesirable for some developers and/or situations, and I'll bet there are a few more reasons that I haven't thought of for why someone might not go down this path.  No worries if this falls into such a category for you.

                     

                     

                    Good luck!

                     

                    -steve

                    • 7. Re: Trapping the Backspace Key
                      bartman352004

                      Thanks for bringing some life back to this post and we can certainly understand the frustration.  We threw our hands up in the air and surrendered to the premise that it was part of Microsoft operational procedure for IE and there were no plans to change it.

                      • 8. Re: Trapping the Backspace Key
                        Nerico

                        Wow!  Thank you so much for working on this.  I'm an amateur FM developer so I'm going to pass this along to a coworker who is an acutal developer. 

                         

                        A quick question, when you mention Safari, are you talking about Safari on Windows? Because I have not been able to reproduce the problem on my Mac and I'm hoping that it is not a potential problem on Macs.

                        • 9. Re: Trapping the Backspace Key
                          Nerico

                          It seems that this problems has been going on for years so you are right, they are not going to fix it.  Speaking as a huge fan of keyboard shortcuts, it is beyond me how anyone could think that this "feature" would be universaly desirable.  I find that web browsing is one area where keyboard shortcuts are least useful.  But even if there are diehard fans of the backspace key, it should have been made easily "disable-able" a long time ago.  I could rant forever since I need to vent from the huge stress attack I experienced over this but I will not inflict this on y'all.  Suffice it to say that I strongly suspect this could be traced to a single MS employee who was bullied by web developers as a young child and decided to exact revenge by making developers have to come up with convoluted workarounds to a useless feature for eternity.

                          • 10. Re: Trapping the Backspace Key
                            steve_ssh

                            Hi Nerico,

                             

                            The delete key ==> back navigation scenario exists on a variety of browsers that run on OSX, though some of these are older versions of the browsers, and in some cases I believe that it is possible for the user to set a configuration to disable this behavior.

                             

                            Safari 5 on OSX has/had this behavior, and I believe that it was removed in Safari 6.  If you do a Google search for something like "safari osx disable delete key navigates back?"  you can see lots of forum posts (albeit old posts) about this topic by users running OSX (and using various browsers).

                             

                            Hope this helps & good luck!

                             

                            -steve