473,659 Members | 2,659 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I alter button value when pressed in ?

I have a button
<input type="button" value="Get data">

When it is clicked a database is accessed and the data is eventually
displayed on the screen.

While the data is being retrieved the button is displayed in its
"pressed in" state.
When the data arrives and is displayed the button pops out to its
normal "unpressed" state.

While the data is being retrieved I would like to alter the appearance
of the button. Ideally I would like to alter its color but more
importantly I would like to alter its value to something like
"Retrieving Data". My problem is I cannot find the button property
corresponding to its "pressed in" state or the events corresponding to
its alteration in appearance.

I guess I could do something onClick but then I am stuck without
knowing what event occurs when the button pops back to its"unpressed"
state.

Can someone enlighten me?
Thanks
N
Jul 27 '07 #1
3 1748
On Jul 27, 3:38 pm, noddy <no...@toyland. comwrote:
I have a button
<input type="button" value="Get data">

When it is clicked a database is accessed and the data is eventually
displayed on the screen.

While the data is being retrieved the button is displayed in its
"pressed in" state.
When the data arrives and is displayed the button pops out to its
normal "unpressed" state.

While the data is being retrieved I would like to alter the appearance
of the button. Ideally I would like to alter its color but more
importantly I would like to alter its value to something like
"Retrieving Data". My problem is I cannot find the button property
corresponding to its "pressed in" state or the events corresponding to
its alteration in appearance.

I guess I could do something onClick but then I am stuck without
knowing what event occurs when the button pops back to its"unpressed"
state.

Can someone enlighten me?
Thanks
N

As far as I know there is no state on a button called "Pressed In" or
anything similar.
I do however got a proposed solution for you:

1. Disable the button after the user clicked on it, and also change
the value of the button if you like
2. When the data arrived (I assume from AJAX), enable the button again

Hope that helps

Hendri Kurniawan

Jul 27 '07 #2
On Fri, 27 Jul 2007 06:14:25 -0000, Hendri Kurniawan
<hc*********@gm ail.comwrote:
>On Jul 27, 3:38 pm, noddy <no...@toyland. comwrote:
>I have a button
<input type="button" value="Get data">

When it is clicked a database is accessed and the data is eventually
displayed on the screen.

While the data is being retrieved the button is displayed in its
"pressed in" state.
When the data arrives and is displayed the button pops out to its
normal "unpressed" state.

While the data is being retrieved I would like to alter the appearance
of the button. Ideally I would like to alter its color but more
importantly I would like to alter its value to something like
"Retrieving Data". My problem is I cannot find the button property
correspondin g to its "pressed in" state or the events corresponding to
its alteration in appearance.

I guess I could do something onClick but then I am stuck without
knowing what event occurs when the button pops back to its"unpressed"
state.

Can someone enlighten me?
Thanks
N


As far as I know there is no state on a button called "Pressed In" or
anything similar.
I do however got a proposed solution for you:

1. Disable the button after the user clicked on it, and also change
the value of the button if you like
2. When the data arrived (I assume from AJAX), enable the button again

Hope that helps

Hendri Kurniawan
Thanks for the suggestion.

In fact I have discovered I was making a problem where there was none.
The on MouseDown and on MouseUp properties correspond to the states I
was referring to.

N
Jul 27 '07 #3
On Fri, 27 Jul 2007 06:14:25 -0000, Hendri Kurniawan
<hc*********@gm ail.comwrote:
>On Jul 27, 3:38 pm, noddy <no...@toyland. comwrote:
>I have a button
<input type="button" value="Get data">

When it is clicked a database is accessed and the data is eventually
displayed on the screen.

While the data is being retrieved the button is displayed in its
"pressed in" state.
When the data arrives and is displayed the button pops out to its
normal "unpressed" state.

While the data is being retrieved I would like to alter the appearance
of the button. Ideally I would like to alter its color but more
importantly I would like to alter its value to something like
"Retrieving Data". My problem is I cannot find the button property
correspondin g to its "pressed in" state or the events corresponding to
its alteration in appearance.

I guess I could do something onClick but then I am stuck without
knowing what event occurs when the button pops back to its"unpressed"
state.

Can someone enlighten me?
Thanks
N


As far as I know there is no state on a button called "Pressed In" or
anything similar.
I do however got a proposed solution for you:

1. Disable the button after the user clicked on it, and also change
the value of the button if you like
2. When the data arrived (I assume from AJAX), enable the button again

Hope that helps

Hendri Kurniawan
Thanks for the suggestion.

In fact I have discovered I was making a problem where there was none.
The on MouseDown and on MouseUp event handlers correspond to the
states I was referring to.

N
Jul 27 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
41044
by: jb | last post by:
Hello, I need to know which button was pressed in the submit , i tried reading the vaule of submit it the validateDate function but it returns 'undefined' value ; I do this in asp all the time, Not sure how to do it in javascript <form name="form1" method="post" action="myNewplace.asp" ONSUBMIT="return ValidateData();"> <input type="Submit" name="Submit" value="Save" >
18
3058
by: jrhoads23 | last post by:
Hello, I am trying to find a way to tell if an .NET windows forms Button (System.Windows.Forms.Button) is "depressed" (pushed down). For my application, I can not use a check box control set to button style, I must use a System.Windows.Forms.Button. I can not find a way to tell when it is momentaraly pressed. I tried calling the API SendMessage with the button handle and BM_GETSTATE to get the state of the button. This will only return...
5
1928
by: Girish | last post by:
I have TWO submit buttons of type IMAGE on my asp form. This renders as <input type="image">. I need to be able to eble the ENTER button for both buttons. Yes, I know that for the input type image, the submit happens automatically to the server. Heres my problem: I have two event handlers for both these buttons as stated below: BUTTON 1:
7
1835
by: Miguel Dias Moura | last post by:
Hello, I am working in ASP.net / VB with Access Database. i have a Multipage in my web site with the Submit button as the last button. When the Submit button is pressed i want the form values to be added to a database and sent by email. 1. I have the code which submits the form values to the database. (See at
2
2794
by: Krista Lemieux | last post by:
Hello, In my form I have a button, and the button_Click function (which gets called when the button is clicked). However the functionality that I have in the button_Click function, needs to be in the Page_Load, since I need to change a value based on the button click to render the page. So my question is, can I access the button object (the sender of the event) in the Page_Load. So that in the Page_Load I can have the following...
7
1862
by: Jimmy Jazz | last post by:
Hi, I have created a control with some buttons an alphabet. When one of these buttons are pressed it posts back and in the postback event for the button pressed a list of tems is created with a list of buttons next to them to delete the term. My problem is that the delete button has a delete event attached to it but t does not fire. Is this because the delete butons are created in the postbaclk event and not the CreateChildControls...
1
7005
by: daonho | last post by:
I tried to use javascript to trigger up the button click function when user press enter key from the textbox. This function work fine with a single button click such has login page. However, if the page has multiple button such login page with a search function somewhere around, then it's not respond properly. I have attached a brief example of two text boxes and two button. When ever a key is press on textbox one, I want to trigger...
3
2498
by: Daniel | last post by:
Hi all, I am using .NET 1.1. I have a form with a cancel button, something like this: <form method="post"....> <input type="submit" value="Submit"> <input type="submit" value="Cancel" id="btnCancel"> </form>
0
8427
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8746
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8525
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7356
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6179
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.