Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Timing an onClick event

Reply
Thread Tools

Timing an onClick event

 
 
EviL KerneL
Guest
Posts: n/a
 
      05-13-2004
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!
 
Reply With Quote
 
 
 
 
Randy Webb
Guest
Posts: n/a
 
      05-13-2004
EviL KerneL wrote:

> 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.


--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/
 
Reply With Quote
 
 
 
 
EviL KerneL
Guest
Posts: n/a
 
      05-14-2004
Randy Webb <> wrote in message news:<>...
> EviL KerneL wrote:
>
> > 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.



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!
 
Reply With Quote
 
Randy Webb
Guest
Posts: n/a
 
      05-14-2004
EviL KerneL wrote:

<--snip-->

>>
>>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?


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.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Overriding an onclick with another onclick tomlong@gmail.com Javascript 4 01-26-2006 09:26 PM
how to handle both onmouseup event and onClick event JerryG ASP .Net 0 12-20-2005 03:49 AM
button.onclick = new Function("func2()") + button.onclick foldface@yahoo.co.uk Javascript 2 09-26-2005 08:13 AM
Timing an onClick event EviL KerneL Javascript 0 05-13-2004 04:52 PM
document.onclick=doIt() same as document.onclick=doIt ? bob Javascript 3 08-21-2003 12:14 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57