Timing an onClick event

E

EviL KerneL

Sorry, I forgot to include the code I was using on my previous message
by the same subject:

Hi -

I have an onClick event in place that switches an button's label to
please wait upon clicking. Problem is, the page on which I am
implementing this event is also running validion to make sure certain
fields are filled.

The problem I am running into is that when the button label's changes
to "Please Wait..." and the page does not change because the user
forgot to fill out one of the fields, the button stays that way and it
does not go back to its original label ("Next"). Because of this, the
user is getting confused and does not know what to press since there
is no Next button anymore.

Is there a way to time this event so that it goes back to its original
label after say, 3 seconds? I was trying to use onBlur but that would
only change the button if the user clicks somewhere else on the page
so it would not serve the purpose.

Here is the code I am using:

<input class="submit-button" type="submit" name="next" value="Next"
onclick="this.form.PdcButtonPressed.value='next';
this.value='Please wait...';">


any help would be greatly appreciated.

Thanks!
 
R

Randy Webb

EviL said:
Sorry, I forgot to include the code I was using on my previous message
by the same subject:

In the future, do not start a new thread, reply to your own. It keeps it
from being broken up into two threads.

Hi -

I have an onClick event in place that switches an button's label to
please wait upon clicking. Problem is, the page on which I am
implementing this event is also running validion to make sure certain
fields are filled.

The problem I am running into is that when the button label's changes
to "Please Wait..." and the page does not change because the user
forgot to fill out one of the fields, the button stays that way and it
does not go back to its original label ("Next"). Because of this, the
user is getting confused and does not know what to press since there
is no Next button anymore.

Is there a way to time this event so that it goes back to its original
label after say, 3 seconds? I was trying to use onBlur but that would
only change the button if the user clicks somewhere else on the page
so it would not serve the purpose.

Here is the code I am using:

<input class="submit-button" type="submit" name="next" value="Next"
onclick="this.form.PdcButtonPressed.value='next';
this.value='Please wait...';">

Have your validation function change it back. But why are you using a
submit button if its not to submit a form? type="button" is better.
 
E

EviL KerneL

Randy Webb said:
In the future, do not start a new thread, reply to your own. It keeps it
from being broken up into two threads.



Have your validation function change it back. But why are you using a
submit button if its not to submit a form? type="button" is better.


Sorry, I was using google groups and since it takes a while for it to
post my post I was not able to go back and reply to my own post.

Can anybody help?

thanks!
 
R

Randy Webb

EviL KerneL wrote:

Sorry, I was using google groups and since it takes a while for it to
post my post I was not able to go back and reply to my own post.

Can anybody help?

The answer was given in my first reply. Have your validation function,
when its finished executing and returns control to the user, change the
button back.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top