473,383 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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 2169
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Deborah V. Gardner | last post by:
I have a list box and would like to point to an item and have a textbox popup referencing a column in the list box. On the list box's MouseDown event I have the following Dim strFullText ...
2
by: JJ | last post by:
Hi All, I need to create a MouseDown event for a picture box . Am I doing the following right? pictureBox.MouseDown += new System.WinForms.MouseEventHandler(pictureBox_MouseDown) Then
1
by: GregM | last post by:
I have a read only datagrid that is designed to coordinate itself with textboxes. When the user clicks on a row in the datagrid, detailed data for that row is displayed for editing in the...
7
by: Scott Mackay | last post by:
Hi, I'm using visual studio dotnet 2002 programming in vb can anyone tell me how I can handle the mousedown event for pictureboxes I create dynamically at runtime? I've tried setting the...
4
by: rsmith | last post by:
How can I capture the MouseDown event on a Label ? I entered thr following code and got a " cannot handle Event 'MouseDown' because they do not have the same signature." Private Sub...
1
by: Merlin | last post by:
I have created a UserControl which has a label; what I wish to do is place this UserControl on a form and then trap the Mouse Down event, whenever someone clicks my control. My problem is that the...
2
by: Rob | last post by:
How can I fix the following warning warning BC40004: sub 'MouseDown' conflicts with event 'MouseDown' in the base class 'Control' and so should be declared 'Shadows'. This warning appears...
1
by: Alan | last post by:
i have a form with a label on it Private Sub Label1_mousedown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Label1.MouseDown ' do stuff End Sub ...
2
by: bretth | last post by:
In a VB.Net Windows Forms application, I have a user control that handles mouse events. Another section of code programmatically adds a label to the control. I would like label to ignore all...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.