By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,855 Members | 1,970 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,855 IT Pros & Developers. It's quick & easy.

How can I alter button value when pressed in ?

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
On Fri, 27 Jul 2007 06:14:25 -0000, Hendri Kurniawan
<hc*********@gmail.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
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
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

P: n/a
On Fri, 27 Jul 2007 06:14:25 -0000, Hendri Kurniawan
<hc*********@gmail.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
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
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 discussion thread is closed

Replies have been disabled for this discussion.