self.focus stopping all keyboard input to window

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark

    self.focus stopping all keyboard input to window

    Hi,

    At the top of my php file I have got :-

    <body onblur="self.fo cus();">

    so when I click off onto another window, my window comes back up in front
    which is perfect. The problem however, is that when I try to type into my
    form boxes, the key transfers are all being lost (i.e. keyboard is
    disabled)!

    Can anyone shed any light?


    Thanks, Mark


  • Andrew Thompson

    #2
    Re: self.focus stopping all keyboard input to window

    On Wed, 17 Nov 2004 20:34:41 GMT, Mark wrote:
    [color=blue]
    > Can anyone shed any light?[/color]

    'Let there be focus'

    Translation: Stop stuffing with the focus in the first place.

    --
    Andrew Thompson
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.PhySci.org/ Open-source software suite
    http://www.1point1C.org/ Science & Technology
    http://www.LensEscapes.com/ Images that escape the mundane

    Comment

    • Mark

      #3
      Re: self.focus stopping all keyboard input to window


      "Andrew Thompson" <SeeMySites@www .invalid> wrote in message
      news:13eq3x7bqq kbt.1wy1sf7kwkl mf.dlg@40tude.n et...[color=blue]
      > On Wed, 17 Nov 2004 20:34:41 GMT, Mark wrote:
      >[color=green]
      >> Can anyone shed any light?[/color]
      >
      > 'Let there be focus'
      >
      > Translation: Stop stuffing with the focus in the first place.
      >[/color]

      Er....say again?


      Thanks, Mark


      Comment

      • Andrew Thompson

        #4
        Re: self.focus stopping all keyboard input to window

        On Wed, 17 Nov 2004 21:01:21 GMT, Mark wrote:
        [color=blue]
        > "Andrew Thompson" <SeeMySites@www .invalid> wrote in message[/color]
        [color=blue][color=green]
        >> On Wed, 17 Nov 2004 20:34:41 GMT, Mark wrote:
        >>[color=darkred]
        >>> Can anyone shed any light?[/color]
        >>
        >> 'Let there be focus'
        >>
        >> Translation: Stop stuffing with the focus in the first place.[/color][/color]
        [color=blue]
        > Er....say again?[/color]

        I'll try it again, slower..

        <body onblur="self.fo cus();"> creates problem. :-(

        <body> fixes problem. ;-)

        --
        Andrew Thompson
        http://www.PhySci.org/codes/ Web & IT Help
        http://www.PhySci.org/ Open-source software suite
        http://www.1point1C.org/ Science & Technology
        http://www.LensEscapes.com/ Images that escape the mundane

        Comment

        • DU

          #5
          Re: self.focus stopping all keyboard input to window

          Mark wrote:[color=blue]
          > Hi,
          >
          > At the top of my php file I have got :-
          >
          > <body onblur="self.fo cus();">
          >
          > so when I click off onto another window, my window comes back up in front
          > which is perfect. The problem however, is that when I try to type into my
          > form boxes, the key transfers are all being lost (i.e. keyboard is
          > disabled)!
          >
          > Can anyone shed any light?
          >
          >[/color]

          Maybe you can shed more light on the whole context. Is that a secondary
          window? Why do you need to make that window always up in front of other
          windows? Can you elaborate on the analysis, webpage context, design
          decision? You maybe trying to find a correct/exact solution to a
          bad/wrong design decision.

          You understand that making a window get the focus like you do is very
          restrictive, very constraining, very user-unfriendly. That's why browser
          manufacturers (Opera, Mozilla for starters; don't know about Konqueror,
          Safari) are now granting users absolute veto powers over raising and
          lowering (against pop-under) windows.

          DU
          --
          The site said to use Internet Explorer 5 or better... so I switched to
          Mozilla 1.7.3 :)

          Comment

          • Mark

            #6
            Re: self.focus stopping all keyboard input to window

            "DU" <drunclear@hotN OSPAMmail.com> wrote in message
            news:30206sF2ri 5s0U1@uni-berlin.de...[color=blue]
            > Mark wrote:[color=green]
            >> Hi,
            >>
            >> At the top of my php file I have got :-
            >>
            >> <body onblur="self.fo cus();">
            >>
            >> so when I click off onto another window, my window comes back up in front
            >> which is perfect. The problem however, is that when I try to type into my
            >> form boxes, the key transfers are all being lost (i.e. keyboard is
            >> disabled)!
            >>
            >> Can anyone shed any light?[/color][/color]

            Hi Du,
            [color=blue]
            > Maybe you can shed more light on the whole context. Is that a secondary
            > window? Why do you need to make that window always up in front of other
            > windows? Can you elaborate on the analysis, webpage context, design
            > decision? You maybe trying to find a correct/exact solution to a bad/wrong
            > design decision.[/color]

            It is for a personal-use script. The program does a 'window.open' to display
            a page
            which shows current horse-prices. The main window then goes to Betfair. I
            then need
            to be able to navigate the betfair website, without my 'information' window
            disappearing,
            so that I may compare prices.

            I agree it may not be the best way to do things, but I was told it would be
            the simplest :-}
            Basically, I need some code which makes sure my window is always at the
            front of the
            betfair window. I do not care whether its java, win32, PHP or ASP as long as
            it gets the
            job done :-)

            Any help would be appreciated.


            Thanks, Mark


            Comment

            • Mark

              #7
              Re: self.focus stopping all keyboard input to window

              "Andrew Thompson" <SeeMySites@www .invalid> wrote in message
              news:14muanibzb xvt$.or2sr8icy9 wm.dlg@40tude.n et...[color=blue]
              > On Wed, 17 Nov 2004 21:01:21 GMT, Mark wrote:
              >[color=green]
              >> "Andrew Thompson" <SeeMySites@www .invalid> wrote in message[/color]
              >[color=green][color=darkred]
              >>> On Wed, 17 Nov 2004 20:34:41 GMT, Mark wrote:
              >>>
              >>>> Can anyone shed any light?
              >>>
              >>> 'Let there be focus'
              >>>
              >>> Translation: Stop stuffing with the focus in the first place.[/color][/color]
              >[color=green]
              >> Er....say again?[/color]
              >
              > I'll try it again, slower..
              >
              > <body onblur="self.fo cus();"> creates problem. :-(
              >
              > <body> fixes problem. ;-)
              >[/color]

              Yes, but will sadly create a new problem - My window will no longer stay at
              the front :-(


              Thanks, Mark


              Comment

              • Andrew Thompson

                #8
                Re: self.focus stopping all keyboard input to window

                On Wed, 17 Nov 2004 23:35:28 GMT, Mark wrote:
                [color=blue]
                > It is for a personal-use script.[/color]

                That changes *everything*, I was thinking you meant on an
                internet site visited by others.

                For a personal script, you can guarantee the environment
                (including single browser) and adjust security settings and
                plug-ins (such as pop-up blockers) as required.

                Have you tried framing the two pages? What are the URLs?

                --
                Andrew Thompson
                http://www.PhySci.org/codes/ Web & IT Help
                http://www.PhySci.org/ Open-source software suite
                http://www.1point1C.org/ Science & Technology
                http://www.LensEscapes.com/ Images that escape the mundane

                Comment

                • rf

                  #9
                  Re: self.focus stopping all keyboard input to window

                  Mark wrote:
                  [color=blue][color=green]
                  > > <body onblur="self.fo cus();"> creates problem. :-(
                  > >
                  > > <body> fixes problem. ;-)
                  > >[/color]
                  >
                  > Yes, but will sadly create a new problem - My window will no longer stay[/color]
                  at[color=blue]
                  > the front :-([/color]

                  How do you know your viewer *wants* your page at the front? That is why they
                  clicked another window, isn't it? To, you know, look at the *other* window.

                  If I were to encounter such a page I would immediately press the back
                  button.

                  --
                  Cheers
                  Richard.


                  Comment

                  • Mark

                    #10
                    Re: self.focus stopping all keyboard input to window


                    "rf" <rf@.invalid> wrote in message
                    news:q0Wmd.3998 4$K7.19084@news-server.bigpond. net.au...[color=blue]
                    > Mark wrote:
                    >[color=green][color=darkred]
                    >> > <body onblur="self.fo cus();"> creates problem. :-(
                    >> >
                    >> > <body> fixes problem. ;-)
                    >> >[/color]
                    >>
                    >> Yes, but will sadly create a new problem - My window will no longer stay[/color]
                    > at[color=green]
                    >> the front :-([/color]
                    >
                    > How do you know your viewer *wants* your page at the front? That is why
                    > they
                    > clicked another window, isn't it? To, you know, look at the *other*
                    > window.
                    >
                    > If I were to encounter such a page I would immediately press the back
                    > button.
                    >[/color]

                    Because it is for an inhouse development on an intranet - and they /will/
                    obey me ;-)


                    Thanks, Mark


                    Comment

                    • Mark

                      #11
                      Re: self.focus stopping all keyboard input to window

                      "Andrew Thompson" <SeeMySites@www .invalid> wrote in message
                      news:1x17y8gy90 yy5.xlq1wxt9axf r.dlg@40tude.ne t...[color=blue]
                      > On Wed, 17 Nov 2004 23:35:28 GMT, Mark wrote:
                      >[color=green]
                      >> It is for a personal-use script.[/color]
                      >
                      > That changes *everything*, I was thinking you meant on an
                      > internet site visited by others.
                      >
                      > For a personal script, you can guarantee the environment
                      > (including single browser) and adjust security settings and
                      > plug-ins (such as pop-up blockers) as required.[/color]

                      Yes, I believe I have done all this to a satisfactory level. The window
                      opens up, and sits there with my page. The main window gets re-directed to
                      the required destination. If you click on the main window, my window comes
                      up on top - All works perfectly, except for the fact, I cannot type in my
                      window (the window contains a form) rendering the whole application useless
                      :-(

                      It /appears/, that when I type, the onblur event is being called, so
                      recalling the window, rather than registering the keypress as a character.

                      [color=blue]
                      > Have you tried framing the two pages? What are the URLs?[/color]

                      No, this is not possible as I need the full screen of the main page, then
                      this popup window is a small window which overlaps a square piece of 'dead
                      space' on the main site.

                      On a side note --- Windows programming is all very new to me, so things like
                      eventhandlers are a complete nightmare. I used to program in C++/ASM back in
                      the days of dos, so I do understand the basics of logic and functions etc,
                      but the windows part is a real non-starter for me - Can anyone recommend any
                      books with good examples? I have various 'reference' books for function
                      names / parameters, but these obviously do not show me how to implement the
                      procedure into my code.


                      Thanks, Mark


                      Comment

                      • rf

                        #12
                        Re: self.focus stopping all keyboard input to window

                        Mark wrote:[color=blue]
                        >
                        > No, this is not possible as I need the full screen of the main page, then
                        > this popup window is a small window which overlaps a square piece of 'dead
                        > space' on the main site.[/color]

                        Sounds like a good excuse for an iframe.

                        --
                        Cheers
                        Richard.


                        Comment

                        • RobB

                          #13
                          Re: self.focus stopping all keyboard input to window

                          "Mark" <mark_news@hors emad.co.uk> wrote in message news:<350nd.30$ 6q3.5@newsfe6-win.ntli.net>.. .[color=blue]
                          > "Andrew Thompson" <SeeMySites@www .invalid> wrote in message
                          > news:1x17y8gy90 yy5.xlq1wxt9axf r.dlg@40tude.ne t...[color=green]
                          > > On Wed, 17 Nov 2004 23:35:28 GMT, Mark wrote:
                          > >[color=darkred]
                          > >> It is for a personal-use script.[/color]
                          > >
                          > > That changes *everything*, I was thinking you meant on an
                          > > internet site visited by others.
                          > >
                          > > For a personal script, you can guarantee the environment
                          > > (including single browser) and adjust security settings and
                          > > plug-ins (such as pop-up blockers) as required.[/color]
                          >
                          > Yes, I believe I have done all this to a satisfactory level. The window
                          > opens up, and sits there with my page. The main window gets re-directed to
                          > the required destination. If you click on the main window, my window comes
                          > up on top - All works perfectly, except for the fact, I cannot type in my
                          > window (the window contains a form) rendering the whole application useless
                          > :-(
                          >
                          > It /appears/, that when I type, the onblur event is being called, so
                          > recalling the window, rather than registering the keypress as a character.
                          >
                          >[color=green]
                          > > Have you tried framing the two pages? What are the URLs?[/color]
                          >
                          > No, this is not possible as I need the full screen of the main page, then
                          > this popup window is a small window which overlaps a square piece of 'dead
                          > space' on the main site.
                          >
                          > On a side note --- Windows programming is all very new to me, so things like
                          > eventhandlers are a complete nightmare. I used to program in C++/ASM back in
                          > the days of dos, so I do understand the basics of logic and functions etc,
                          > but the windows part is a real non-starter for me - Can anyone recommend any
                          > books with good examples? I have various 'reference' books for function
                          > names / parameters, but these obviously do not show me how to implement the
                          > procedure into my code.
                          >
                          >
                          > Thanks, Mark[/color]

                          Boy, people certainly are argumentative around here...

                          Have you looked into HTAs? Where browser coverage isn't an issue - and
                          you don't mind using IE (ugh) the flexibility is tremendous.

                          Otherwise...

                          <?xml version="1.0" encoding="iso-8859-1"?>
                          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
                          <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
                          <head>
                          <title>untitled </title>
                          </head>
                          <body>
                          <input type="button" value="open it"
                          onclick="window .open('pop.html ','pop','width= 400,height=300, left=100,top=10 0,status=0')"
                          />
                          </body>
                          </html>


                          [pop.html]
                          <?xml version="1.0" encoding="iso-8859-1"?>
                          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
                          <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
                          <head>
                          <title>untitled </title>
                          <script type="text/javascript">
                          //<![CDATA[

                          var timerID = null;

                          onblur = function()
                          {
                          timerID = setTimeout('sel f.focus()', 50);
                          }

                          onload = function()
                          {
                          var i = 0, el, els =
                          document.getEle mentsByTagName( 'form').item(0) .elements;
                          while (el = els.item(i++))
                          if (/text(area)?/.test(el.type))
                          {
                          el.onfocus = function()
                          {
                          if (timerID)
                          clearTimeout(ti merID);
                          }
                          el.onblur = function()
                          {
                          timerID = setTimeout('sel f.focus()', 50);
                          }
                          }
                          self.focus();
                          }

                          //]]>
                          </script>
                          </head>
                          <body>
                          <form style="width:12 0px;">
                          <input type="text" name="foo" value="" />
                          <input type="text" name="feh" value="" />
                          <textarea name="hah" rows="4" cols="24"></textarea>
                          </form>
                          </body>
                          </html>

                          Just uses a timer to 'reverse' the order of blur/focus firing so you
                          can control them. Assuming one form in that popup.

                          Comment

                          • Mark

                            #14
                            Re: self.focus stopping all keyboard input to window


                            "RobB" <ferndoc9@hotma il.com> wrote in message
                            news:ab354593.0 411180951.f0435 dc@posting.goog le.com...[color=blue]
                            > "Mark" <mark_news@hors emad.co.uk> wrote in message
                            > news:<350nd.30$ 6q3.5@newsfe6-win.ntli.net>.. .[color=green]
                            >> "Andrew Thompson" <SeeMySites@www .invalid> wrote in message
                            >> news:1x17y8gy90 yy5.xlq1wxt9axf r.dlg@40tude.ne t...[color=darkred]
                            >> > On Wed, 17 Nov 2004 23:35:28 GMT, Mark wrote:
                            >> >[/color]
                            >>
                            >> It /appears/, that when I type, the onblur event is being called, so
                            >> recalling the window, rather than registering the keypress as a
                            >> character.
                            >>
                            >>[color=darkred]
                            >> > Have you tried framing the two pages? What are the URLs?[/color]
                            >>
                            >> No, this is not possible as I need the full screen of the main page, then
                            >> this popup window is a small window which overlaps a square piece of
                            >> 'dead
                            >> space' on the main site.
                            >>
                            >> On a side note --- Windows programming is all very new to me, so things
                            >> like
                            >> eventhandlers are a complete nightmare. I used to program in C++/ASM back
                            >> in
                            >> the days of dos, so I do understand the basics of logic and functions
                            >> etc,
                            >> but the windows part is a real non-starter for me - Can anyone recommend
                            >> any
                            >> books with good examples? I have various 'reference' books for function
                            >> names / parameters, but these obviously do not show me how to implement
                            >> the
                            >> procedure into my code.
                            >>
                            >>
                            >> Thanks, Mark[/color]
                            >
                            > Boy, people certainly are argumentative around here...
                            >[/color]

                            Sure are <lol>, it has took numerous replys before any kind of code /
                            functions were even mentioned.

                            [color=blue]
                            > Have you looked into HTAs? Where browser coverage isn't an issue - and
                            > you don't mind using IE (ugh) the flexibility is tremendous.[/color]

                            Sorry to sound a bit thick, but what does HTAs stand for?

                            [color=blue]
                            >
                            > Otherwise...
                            >
                            > <?xml version="1.0" encoding="iso-8859-1"?>
                            > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                            > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">[/color]
                            [color=blue][color=green][color=darkred]
                            >>>> CODE SNIPPED <<<<[/color][/color][/color]

                            One phrase springs to mind 'King amongst men'.

                            Rob, I cannot thank you enough. I have just got home at 03:40am after
                            spending the day driving through snow and achieving very little- copied and
                            pasted your code and run it, and it works perfectly. I am not even going to
                            try and understand nor modify it until I have had at least 5 hours sleep,
                            but at least now, I know I have the basecode to do the job properly.

                            Thanks ever so much, it is truly appreciated.


                            Thanks, Mark


                            Comment

                            • Andrew Thompson

                              #15
                              Re: self.focus stopping all keyboard input to window

                              On Fri, 19 Nov 2004 03:53:09 GMT, Mark wrote:
                              [color=blue][color=green]
                              >> Have you looked into HTAs? Where browser coverage isn't an issue - and
                              >> you don't mind using IE (ugh) the flexibility is tremendous.[/color]
                              >
                              > Sorry to sound a bit thick, but what does HTAs stand for?[/color]

                              AFAIU..

                              It stands for Hyper Text Application.
                              It is an 'whatever.html' , renamed to 'whatever.hta'.

                              IE then recognizes that web-page as being a 'signed' web application
                              that can then gain extended privileges to perform functionality that
                              would not normally be allowed in an internet environment. This
                              includes having control of programs outside the browser, or access
                              to the local filesystem (the user's hard disk).

                              HTH

                              --
                              Andrew Thompson
                              http://www.PhySci.org/codes/ Web & IT Help
                              http://www.PhySci.org/ Open-source software suite
                              http://www.1point1C.org/ Science & Technology
                              http://www.LensEscapes.com/ Images that escape the mundane

                              Comment

                              Working...