Arrow keys and enter key not functioning in Firefox 3.6 when viewing PDF

I'm using Adobe Reader 9.3.0.
I have a web application that displays PDFs (using Adobe Reader) in a browser.  The PDF is loaded onto the page inside an IFRAME.  In addition to the IFRAME containing a PDF, the page also includes several forms, text fields, etc. For the most part this is working fine.  However, I have a glitch when using this in Firefox 3.6. I'm finding that certain keyboard events are being lost and I strongly suspect that they are being swallowed by Adobe Reader.  When I place focus on an HTML text field and press enter key or arrow keys, I do not get the appropriate key events.  If I run the exact same test without the PDF IFRAME these key events work correctly, but as soon as I load the PDF into the IFRAME they do not.  I believe the primary key event that gets lost is the keydown event.  I do get the keyup event.
Again, the events work correctly up until I load the PDF onto the page.
I've verified that this error does not occur in Firefox 3.5 and 3.0.
Here is a testcase to reproduce this:
<html>
<head>
    <title>JavaScript - Detecting keystrokes</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script type="text/javascript">
        var pdfURL = 'http://samplepdf.com/sample.pdf';
        window.onload = function () {
            init();
        document.defaultAction = true;
        function init() {
            var x = document.getElementById('testForm').getElementsByTagName('input');
            for (var i=0;i<x.length;i++) {
                x[i].onclick = setEvents;
                if (x[i].checked)
                    x[i].onclick();
            writeroot = document.getElementById('writeroot');
            document.getElementById('emptyWriteroot').onclick = function () {
                writeroot.innerHTML = '';
                return false;
        function setEvents() {
            if (this.id == 'default') {
                document.defaultAction = !this.checked;
                return;
            var eventHandler = (this.checked) ? detectEvent : empty;
            document.getElementById('textfield')['on'+this.id] = eventHandler;
            //document['on'+this.id] = eventHandler;
        function detectEvent(e) {
            var evt = e || window.event;
            writeData('<b>'+evt.type+'</b>:  keyCode=' + evt.keyCode+' : charCode=' + evt.charCode);
            return document.defaultAction;
        function empty() {
            // nothing
        var writeroot;
        function writeData(msg) {
            writeroot.innerHTML += msg + '<br />';
    </script>
    <style type="text/css">
        body {
            font-size: 12px;
        #writeroot {
            height: 300px;
            overflow: auto;
            border: 1px solid #2EB2DC;
    </style>
</head>
<body>
<form id="testForm">
<input type="checkbox" id="keydown" /> <label for="keydown">keydown</label><br />
<input type="checkbox" id="keypress" /> <label for="keypress">keypress</label><br />
<input type="checkbox" id="keyup" /> <label for="keyup">keyup</label><br />
<input type="checkbox" id="default" /> <label for="default">Suppress default action</label><br />
<input type="text" id="textfield" /><br />
<button id="emptyWriteroot">Remove messages</button>
</form>
<a href="#" onclick="document.getElementById('docviewer-page').src=pdfURL;return false">Now load IFrame</a>
<p id="writeroot"></p>
<div id="container2" style="border:1px solid black;width:400px;height:200px">
        <iframe
            id='docviewer-page'
            name='docviewer-page'
            title='document page'
            src='http://www.google.com'
            align='left'
            width='100%'
            height='100%'
            scrolling='auto'
            frameborder=0></iframe>
</div>
</body>
</html>
Paste the above into an HTML document.  Open the HTML document in Firefox 3.6.  Check the four checkboxes.  Move into the text field and press arrow keys and enter key to observe the results when it is working correctly.  Then click on the "Now Load PDF" link.  Press the arrow keys and enter key again and observe that the behavior has changed.
Anybody have any idea why this is happening or how to work around it?

I found a workaround!
By using an object tag instead of an iframe, all the keys seems to work fine and the PDF still renders in the page the same way.
Here's a page that works:
<html>
<head>
    <title>JavaScript - Detecting keystrokes</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script type="text/javascript">
        var pdfURL = 'http://samplepdf.com/sample.pdf';
        window.onload = function () {
            init();
        document.defaultAction = true;
        function init() {
            var x = document.getElementById('testForm').getElementsByTagName('input');
            for (var i=0;i<x.length;i++) {
                x[i].onclick = setEvents;
                if (x[i].checked)
                    x[i].onclick();
            writeroot = document.getElementById('writeroot');
            document.getElementById('emptyWriteroot').onclick = function () {
                writeroot.innerHTML = '';
                return false;
        function setEvents() {
            if (this.id == 'default') {
                document.defaultAction = !this.checked;
                return;
            var eventHandler = (this.checked) ? detectEvent : empty;
            document.getElementById('textfield')['on'+this.id] = eventHandler;
            //document['on'+this.id] = eventHandler;
        function detectEvent(e) {
            var evt = e || window.event;
            writeData('<b>'+evt.type+'</b>:  keyCode=' + evt.keyCode+' : charCode=' + evt.charCode);
            return document.defaultAction;
        function empty() {
            // nothing
        var writeroot;
        function writeData(msg) {
            writeroot.innerHTML += msg + '<br />';
    </script>
    <style type="text/css">
        body {
            font-size: 12px;
        #writeroot {
            height: 300px;
            overflow: auto;
            border: 1px solid #2EB2DC;
    </style>
</head>
<body>
<form id="testForm">
<input type="checkbox" id="keydown" /> <label for="keydown">keydown</label><br />
<input type="checkbox" id="keypress" /> <label for="keypress">keypress</label><br />
<input type="checkbox" id="keyup" /> <label for="keyup">keyup</label><br />
<input type="checkbox" id="default" /> <label for="default">Suppress default action</label><br />
<input type="text" id="textfield" /><br />
<button id="emptyWriteroot">Remove messages</button>
</form>
<a href="#" onclick="document.getElementById('docviewer-page').data=pdfURL;return false">Now load IFrame</a>
<p id="writeroot"></p>
<div id="container2" style="border:1px solid black;width:400px;height:200px">
        <object
            id='docviewer-page'
            name='docviewer-page'
            title='document page'
            data='http://www.google.com'
            align='left'
            width='100%'
            height='100%'
            ></object>
</div>
</body>
</html>

Similar Messages

  • Up and Down Arrow Keys Not Functioning in CS2 for Windows

    A little over 6 months ago I purchased Adobe Photoshop CS2 for Windows XP and installed it on my work PC and my home PC. Everything works fine and dandy on my work PC, however when I try to do some editting on my home PC there are some quirks that I can't figure out. The main thing is that my Up/Down Arrow Keys do absolutely nothing. Whether I am trying to edit text and scroll through my fonts or if I'm trying to nudge a part of a picture, the Arrow keys do nothing.
    Does anybody have any suggestions for me?
    Any help would be greatly appreciated.
    Thanks.

    >but that's beside the point.
    it's not. what you describe is typical behavior of a high quality cracked version that's been floating around. a great copy with shrink wrap, nice manuals, etc. but you've been burned. usually the discs are stamped "made in singapore".
    try to get your money back.

  • Arrow key not functioning

    My arrow keys are not functioning when I tried to use them to move my objects. They work fine in InDesign and Photoshop, but not responding at all in Illustrator. Anyone knows why?
    Thanks!

    Always mention the version of Illustrator & the OS you are using.
    Check if by any chance the 'Keyboard Increment' in Preferences (Ctrl/Cmd-K) is set to 0.

  • Middle mouse button does not function for Firefox Tab browsing when cetain programs are running.

    My Microsoft Comfort Mouse 3000 middle button is set in Firefox to open and close tabs. (In Control Panel, Mouse, Firefox is the only program exception and the Wheel button is set to middle-click instead of the default Instant Viewer).
    When vlc media player (http://www.videolan.org/vlc/) is running and at some point viewed in full screen, the middle mouse button reverts in Firefox to the default Instant Viewer. When vlc is closed, tab operation once again works.
    The same thing happens if MWSnap screen capture (http://www.mirekw.com/winfreeware/mwsnap.html) is running.

    Very glad to see I am not alone. Alas....that answer did nothing on my system. I also am very very frustrated that, all of a sudden, my middle mouse button brings up a weird four pointed arrow! (see pic) I NEED it to open links in tabs for researching!!
    I turned off auto scrolling in the advanced settings. Restarted FF even...and nada.
    I have disabled every single add on I had (only like 6 of them)...and nothing.
    This happened all the sudden...I dont even know of an update. FF v3.6.10

  • HP G62-348CA number keys and arrow keys not working

    Good day Experts! Can someone help me fix my laptop? I got G62-348CA unit. only number 5 and 6 in my number keys are working and also arrow keys down and right are not functioning. at first it was built with windows 7 home premium 64bit but then i have to reformat my laptop with windows 7 ultimate but i dont have available 64bit so i install 32bit of the OS. before i install the OS, number keys and arrow keys are working fine but after I reformat my laptop with ultimate 32bit, the said keys are not working. please guys help me. im having trouble with my unit and i dont know what to do. its pretty bad i dont have any idea. all the best with you guys and i'm hoping for your fast and kind response. thank you!

    Because the operating system does not affect the keyboard in that way . .. If the operating system has issues it would switch keys or assign wrong characters.
    I have replaced over 200 keyboards because of such issues

  • Enter key not functioning pls i need to resume backing,enter key not function another option pls.

    Enter key not functioning pls i need to resume back,enter key not function another option pls hp mini laptop.

    Hello Damyanology,
    If your enter key is not working but you have to use it, you can bring up the on screen keyboard, and that will allow you to use enter.
    Here is a link to open the on screen keyboard.
    Go into device manager and uninstall the keyboard and restart the computer. This should reinstall the driver to correct the problem.
    Here is a link to uninstall in device manager.
    Let me know if this helps.

  • The keyboard for my iMac 9, 1 got wet and is not working correctlly. Delete,return, and some other keys not functioning. In all caps including numerals. I've left it to dry for a few days but still will not work. Computer now in Safe boot mode and I c

    The keyboard for my iMac 9, got wet and is not working correctly. Delete ,return, and some other keys not functioning. In all caps including numerals. I've left it to dry for a few days but still will not work. Computer now in Safe boot mode and I can't login due to all caps and numbers being symbols. Is there anything I can do?

    Buy a replacement keyboard. They're only $50-65 USD.
    27" i7 iMac (Mid 2011) refurb, OS X Yo (10.10), Mavs, ML & SL, G4 450 MP w/10.5 & 9.2.2

  • Function keys not functioning.....

    After I installed OS X Lion on my MacBook Pro the function keys at the top of my keyboard no longer function normally. Most of them do nothing when pressed except the volume keys, the volume down switches to spaces and the volume up key brings up the dashboard. The other keys have no action. The workaround that I have found so far is to actually press the fn key while executing the commands. I do not know if there is a setting in the system preferences or what but this is getting to be very annoying. Anyone else having this problem? If so does anyone know how to fix this?

    I am having the same issues with some of my F keys. Just purchased my first MAC (long time Windower ;-), so I'm still finding my way around. I have Lion, and was thinking, are some of the F keys not functioning because Lion does that funtion a different way?  I will post it here if I find your answer.
    Good luck

  • My audio and cam is not functioning anymore.my laptop model is Satellite A200-130.what shall i do?

    im having a problem with my laptop.the audio and cam is not functioning.i dont know why/
    please help me what to do.do you think program files about these were deleted?

    Probably best to post in the Toshiba Support Forums Europe.
    -Jerry

  • Suddenly 2 of my apps (Facebook and Skype) will not function on my ipod. They just close down when I touch the ikon.

    Suddenly 2 of my apps (Facebook and Skype) will not function on my ipod touch. They just close down when I touch the ikons.

    If that does not work try resetting your iPod:
    Reset iPod touch:  Press and hold the On/Off Sleep/Wake button and the Home
    button at the same time for at least ten seconds, until the Apple logo appears.

  • I just downloaded Photoshop Elements 13 and IMPORT is not functional.    What is wrong?

    I just downloaded Photoshop Elements 13 and IMPORT is not functional.    I reinstalled the printer /scanner and still not functional.   My computer is recognizing the printer.   What is wrong?

    I guess the first thing you now need to do is to get the latest drivers for your printer because as you say you uninstalled it from your machine and now reinstalled it again.  I don't know why you thought printer should have been uninstall;led but anyway, please reinstall the driver and then see if it is recognized by your operating system and try scanning something as a test from outside the PSE13 before going back to PSE13 and trying to scan your real image.
    Please post back so that Barbara or R_Kelly can help you as I don't use Apple Mac.

  • I recently had to disable and enable all add-ons on Firefox. Now when I google something, when I hover over the website preview and click 'cached' it won't highlight the key terms anymore. How can I fix this?

    I recently had to disable and enable all add-ons on Firefox. Now when I google something, when I hover over the website preview and click 'cached' it won't highlight the key terms anymore. How can I fix this?

    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    *Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Safari says "i cannot open the page because the server cannot be found" I get this on Safari and Mail does not function. Apps work like a dream. All Windows OS are screaming. Any thoughts?

    Safari says "i cannot open the page because the server cannot be found" I get this on Safari and Mail does not function. Apps work like a dream. All Windows OS are screaming. Any thoughts?

    You can check this thread for the answer you are looking for.
    https://discussions.apple.com/thread/3685247?start=0&tstart=0

  • I've recently downloaded Lion and find my Microsoft excel, word, entourage and powerpoint do not function. It says these functions are not now supported. Why and how do I get to use them again?

    I've recently downloaded Lion and find my Microsoft excel, word, entourage and powerpoint do not function. It says these functions are not now supported. Why and how do I get to use them again?

    philippnoe wrote:
    What a "great" Program which is supporting many nice but not mandatory things but is not supporting a Program which is used day by day from many users ... and especially this Program is also sold officially by apple !!!
    Yeah!, Why, Lion won't even run my old DOS programs! 

  • HT1430 i updated my ipod touch and it is not functioning.  The apple logo blinks and it didin't turn off either.  Any help?

    i updated my ipod touch and it is not functioning.  The logo is blinking and it doesn't turn off either.  Any help?

    Try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try on another computer                            
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar                                     

Maybe you are looking for