469,579 Members | 1,195 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,579 developers. It's quick & easy.

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
Jul 23 '05 #1
10 2017
I don't have a ready answer for the question, but I am curious why you'd
want to do such a thing?
"john" <jo********@yahoo.com> wrote in message
news:29**************************@posting.google.c om...
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

Jul 23 '05 #2
On 19 Apr 2004 11:24:33 -0700, john <jo********@yahoo.com> wrote:
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?


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: pa******@yahoo.it (Paolo Mancini)
Subject: Cancel click event an a page
Date: 19 Apr 2004 09:36:50 -0700
Msg-ID: <46**************************@posting.google.com >

Mike

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 23 '05 #3
In article <29**************************@posting.google.com >,
jo********@yahoo.com enlightened us with...
I want the page to completely ignore all mouse clicks.
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.
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.


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!!!!!!
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #4
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.
Jul 23 '05 #5
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.style.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" <jo********@yahoo.com> wrote in message
news:29**************************@posting.google.c om...
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.

Jul 23 '05 #6
john wrote:
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.


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

Jul 23 '05 #7
In article <29**************************@posting.google.com >,
jo********@yahoo.com enlightened us with...
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.


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?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #8
On Tue, 20 Apr 2004 11:14:44 -0500, kaeli <ti******@NOSPAM.comcast.net>
wrote:
In article <29**************************@posting.google.com >,
jo********@yahoo.com enlightened us with...
[disable controls and display hourglass]
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.


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.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 23 '05 #9
On Tue, 20 Apr 2004 08:37:14 -0500, William Morris
<ne***************************@seamlyne.com> wrote:
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.
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.
When you click "submit", hide the button, show the message, and if
you like change the document.body.style.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.
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="return validate(this)">
<input id="send" type="submit" onclick="toggleSubmit(this)"
value="Send">
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.


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

[snip]

Mike

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 23 '05 #10
In article <op**************@news-text.blueyonder.co.uk>,
M.******@blueyonder.co.invalid enlightened us with...

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?


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.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Deborah V. Gardner | last post: by
2 posts views Thread by JJ | last post: by
1 post views Thread by GregM | last post: by
7 posts views Thread by Scott Mackay | last post: by
4 posts views Thread by rsmith | last post: by
1 post views Thread by Merlin | last post: by
1 post views Thread by Alan | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.