How can I make the page ignore the mousedown event?

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

    How can I make the page ignore the mousedown event?

    I want the page to completely ignore all mouse clicks. I can create
    the onmouseclick event and return false, but that only disables
    certain types of things. I can still, for example, click in a text box
    and then type something or change the selection in a dropdown list. I
    tried returning false in the onmousedown event, but that didn't do the
    trick. I'd rather not have to disabled all the controls on the page.
    Any ideas?
    Thanks in advance,
    John
  • William Morris

    #2
    Re: How can I make the page ignore the mousedown event?

    I don't have a ready answer for the question, but I am curious why you'd
    want to do such a thing?


    "john" <johngilmer@yah oo.com> wrote in message
    news:2947476e.0 404191024.39ef4 f1c@posting.goo gle.com...[color=blue]
    > I want the page to completely ignore all mouse clicks. I can create
    > the onmouseclick event and return false, but that only disables
    > certain types of things. I can still, for example, click in a text box
    > and then type something or change the selection in a dropdown list. I
    > tried returning false in the onmousedown event, but that didn't do the
    > trick. I'd rather not have to disabled all the controls on the page.
    > Any ideas?
    > Thanks in advance,
    > John[/color]


    Comment

    • Michael Winter

      #3
      Re: How can I make the page ignore the mousedown event?

      On 19 Apr 2004 11:24:33 -0700, john <johngilmer@yah oo.com> wrote:
      [color=blue]
      > I want the page to completely ignore all mouse clicks. I can create
      > the onmouseclick event and return false, but that only disables
      > certain types of things. I can still, for example, click in a text box
      > and then type something or change the selection in a dropdown list. I
      > tried returning false in the onmousedown event, but that didn't do the
      > trick. I'd rather not have to disabled all the controls on the page.
      > Any ideas?[/color]

      Read the thread, "Cancel click event an a page" [sic], posted by Paolo
      Mancini earlier today. My response to that question is the same.

      Author: paomanci@yahoo. it (Paolo Mancini)
      Subject: Cancel click event an a page
      Date: 19 Apr 2004 09:36:50 -0700
      Msg-ID: <4640f2b7.04041 90836.3ccf6c38@ posting.google. com>

      Mike

      --
      Michael Winter
      M.Winter@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)

      Comment

      • kaeli

        #4
        Re: How can I make the page ignore the mousedown event?

        In article <2947476e.04041 91024.39ef4f1c@ posting.google. com>,
        johngilmer@yaho o.com enlightened us with...[color=blue]
        > I want the page to completely ignore all mouse clicks.[/color]

        Bad Idea (tm). I use my mouse for page navigation. Many disabled people
        do, too. You ignore all clicks, you disallow mouse navigation. Not good.
        [color=blue]
        > I can create
        > the onmouseclick event and return false, but that only disables
        > certain types of things. I can still, for example, click in a text box
        > and then type something or change the selection in a dropdown list. I
        > tried returning false in the onmousedown event, but that didn't do the
        > trick. I'd rather not have to disabled all the controls on the page.[/color]

        Why would they ALL need disabled? If that's the case, just don't allow
        form submittal.

        If a few need "disabled", but you want them submitted, there's several
        solutions to that, depending on what your needs really are. None of them
        involve disabling clicking on the main document.


        --
        --
        ~kaeli~
        Press any key...NO, NO, NO, NOT THAT ONE!!!!!!



        Comment

        • john

          #5
          Re: How can I make the page ignore the mousedown event?

          Thanks for the responses. It seems that there's no easy way to do what
          I want to do. Since two of you have asked why I would want do such a
          thing, here is the reason: When the user has clicked on a button that
          is causing the browser to post back to the server, it could take a
          little while for the new page to show up. So in the mean time, I want
          to change the cursor to an hourglass and not allow the user to do
          anything with any of the controls on the page.

          Comment

          • William Morris

            #6
            Re: How can I make the page ignore the mousedown event?

            If THAT's all you want to do, then here's a possible solution: have a
            message inside some sort of container that says "Please Wait..." or somesuch
            that is adjacent to the Submit button and is hidden when the page loads.
            When you click "submit", hide the button, show the message, and if you like
            change the document.body.s tyle.cursor = 'wait' (warning: NOT cross-browser).
            You'll probably have to replace the Submit button with a "button" button,
            with an onClick event handler that toggles visibility and then
            form.submit()'s . If you really want to walk down the verbose road, loop all
            of the form elements and set disabled=true (warning: NOT cross-browser).
            YMMV.

            Here's the deal, John: once the user clicks the button and the form has been
            submitted, the user can do whatever they want to the page and they're not
            going to change what was sent: it's already gone. You can take the submit
            button away to prevent them from submitting again, which is what it sounds
            like you really want to do anyway. We do this sort of thing all the time in
            our own web applications.

            - Wm

            --
            William Morris
            Semster, Seamlyne reProductions
            Visit our website, http://www.seamlyne.com, for the most comfortable
            historically inspired clothing you can buy!


            "john" <johngilmer@yah oo.com> wrote in message
            news:2947476e.0 404200456.75de0 a66@posting.goo gle.com...[color=blue]
            > Thanks for the responses. It seems that there's no easy way to do what
            > I want to do. Since two of you have asked why I would want do such a
            > thing, here is the reason: When the user has clicked on a button that
            > is causing the browser to post back to the server, it could take a
            > little while for the new page to show up. So in the mean time, I want
            > to change the cursor to an hourglass and not allow the user to do
            > anything with any of the controls on the page.[/color]


            Comment

            • Brian Genisio

              #7
              Re: How can I make the page ignore the mousedown event?

              john wrote:
              [color=blue]
              > Thanks for the responses. It seems that there's no easy way to do what
              > I want to do. Since two of you have asked why I would want do such a
              > thing, here is the reason: When the user has clicked on a button that
              > is causing the browser to post back to the server, it could take a
              > little while for the new page to show up. So in the mean time, I want
              > to change the cursor to an hourglass and not allow the user to do
              > anything with any of the controls on the page.[/color]

              Blur the controls (using blur()) and do not allow for form submittal.

              It is a lot better than making the browser look like it is froze.

              Brian

              Comment

              • kaeli

                #8
                Re: How can I make the page ignore the mousedown event?

                In article <2947476e.04042 00456.75de0a66@ posting.google. com>,
                johngilmer@yaho o.com enlightened us with...[color=blue]
                > Thanks for the responses. It seems that there's no easy way to do what
                > I want to do. Since two of you have asked why I would want do such a
                > thing, here is the reason: When the user has clicked on a button that
                > is causing the browser to post back to the server, it could take a
                > little while for the new page to show up. So in the mean time, I want
                > to change the cursor to an hourglass and not allow the user to do
                > anything with any of the controls on the page.
                >[/color]

                That's a very bad idea. I tried something similar. When the server had
                issues and the page timed out, the user had no way to resubmit the form.
                They had to refresh the page, thereby losing any changes they made.

                Better to just pop up an alert or put in text on the page indicating
                that processing has started. That's what I ended up with.

                --
                --
                ~kaeli~
                Why do they lock gas station bathrooms? Are they afraid
                someone will clean them?



                Comment

                • Michael Winter

                  #9
                  Re: How can I make the page ignore the mousedown event?

                  On Tue, 20 Apr 2004 11:14:44 -0500, kaeli <tiny_one@NOSPA M.comcast.net>
                  wrote:
                  [color=blue]
                  > In article <2947476e.04042 00456.75de0a66@ posting.google. com>,
                  > johngilmer@yaho o.com enlightened us with...[/color]

                  [disable controls and display hourglass]
                  [color=blue]
                  > That's a very bad idea. I tried something similar. When the server had
                  > issues and the page timed out, the user had no way to resubmit the form.
                  > They had to refresh the page, thereby losing any changes they made.
                  >
                  > Better to just pop up an alert or put in text on the page indicating
                  > that processing has started. That's what I ended up with.[/color]

                  Assuming that the delay is due to server processing and returning the
                  results, not sending the data, would it be feasible to return a small
                  intermediate page that would forward the user to the results page? As most
                  browsers retain form values, a user could still use the Back button to
                  return to the first page if the connection fails for some reason. The only
                  disadvantage I see at the moment is that temporary storage is needed on
                  the server to store the data during the transition.

                  You have more server-side knowledge than I do. What do you think?

                  Just a thought,
                  Mike

                  --
                  Michael Winter
                  M.Winter@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)

                  Comment

                  • Michael Winter

                    #10
                    Re: How can I make the page ignore the mousedown event?

                    On Tue, 20 Apr 2004 08:37:14 -0500, William Morris
                    <news.remove.th is.and.the.dots @seamlyne.com> wrote:
                    [color=blue]
                    > If THAT's all you want to do, then here's a possible solution: have a
                    > message inside some sort of container that says "Please Wait..." or
                    > somesuch that is adjacent to the Submit button and is hidden when the
                    > page loads.[/color]

                    It would be more reliable to show a permanent message above the submit
                    button that informs the user that the results may take some time to return
                    and that the user should be patient.
                    [color=blue]
                    > When you click "submit", hide the button, show the message, and if
                    > you like change the document.body.s tyle.cursor = 'wait' (warning: NOT
                    > cross-browser). You'll probably have to replace the Submit button with a
                    > "button" button, with an onClick event handler that toggles visibility
                    > and then form.submit()'s .[/color]

                    An interesting idea. However, it might be more easily accomplished by
                    something like

                    function toggleSubmit( button ) {
                    button.value = ( 'Send' == button.value ) ?
                    'Please wait...' : 'Send';
                    }

                    function validate( form ) {
                    // ...
                    return( form.elements[ 'send' ].value != 'Send' );
                    }

                    <form ... onsubmit="retur n validate(this)" >
                    <input id="send" type="submit" onclick="toggle Submit(this)"
                    value="Send">
                    [color=blue]
                    > If you really want to walk down the verbose road, loop all of the form
                    > elements and set disabled=true (warning: NOT cross-browser).
                    > YMMV.[/color]

                    However, you would have to do that *after* the form was sent, otherwise
                    nothing would be transmitted!

                    [snip]

                    Mike

                    --
                    Michael Winter
                    M.Winter@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)

                    Comment

                    • kaeli

                      #11
                      Re: How can I make the page ignore the mousedown event?

                      In article <opr6s7pemf5vkl cq@news-text.blueyonder .co.uk>,
                      M.Winter@blueyo nder.co.invalid enlightened us with...[color=blue]
                      >
                      > Assuming that the delay is due to server processing and returning the
                      > results, not sending the data, would it be feasible to return a small
                      > intermediate page that would forward the user to the results page?[/color]

                      Feasible? Sure.
                      Worth the effort? That's very subjective, and I decided it was not. If
                      it were something that happened often and caused problems, I might be
                      more inclined, but it was only one report out of many that took so long
                      to run. I usually manage to make my reports run fast enough so it isn't
                      an issue. This was a big one requested by a user and only a few people
                      use it.
                      I might also decide it was worth if effort if it were an internet
                      application. Mine is intranet and I know my users.

                      YMMV.


                      --
                      --
                      ~kaeli~
                      He's your God, they're your rules - you burn in Hell.



                      Comment

                      Working...