471,859 Members | 1,967 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

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 1661
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*********@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
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.

Similar topics

7 posts views Thread by Miguel Dias Moura | last post: by
7 posts views Thread by Jimmy Jazz | last post: by
3 posts views Thread by Daniel | last post: by
NeoPa
reply views Thread by NeoPa | last post: by

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.