PC Review


Reply
 
 
David C
Guest
Posts: n/a
 
      7th Oct 2009
I have an aspx page with Javascript that shows a message from a hidden
textbox as shown below.

var vmsg = document.getElementById('txtMsg');
if (vmsg.value != '') {
alert(vmsg.value);
document.getElementById('txtMsg').value = '';
}


I would like to have the alert box display for 3 seconds and then close. I
have tried the window.setTimeout with no success. Is there a way to
accomplish this? Thanks.

David


 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      7th Oct 2009
On Oct 7, 6:25*pm, "David C" <dlch...@lifetimeinc.com> wrote:
> I have an aspx page with Javascript that shows a message from a hidden
> textbox as shown below.
>
> * * var vmsg = document.getElementById('txtMsg');
> * * if (vmsg.value != '') {
> * * * * alert(vmsg.value);
> * * * * document.getElementById('txtMsg').value = '';
> * * }
>
> I would like to have the alert box display for 3 seconds and then close. *I
> have tried the window.setTimeout with no success. *Is there a way to
> accomplish this? *Thanks.
>
> David


I think, you can't do this with JavaScript. You can do a hidden div
and show it instead of alert function, like in the example below:

http://forums.tizag.com/archive/index.php?t-961.html
 
Reply With Quote
 
David C
Guest
Posts: n/a
 
      7th Oct 2009

"Alexey Smirnov" <(E-Mail Removed)> wrote in message
news:cb348d3d-50fd-4a69-a963-(E-Mail Removed)...
On Oct 7, 6:25 pm, "David C" <dlch...@lifetimeinc.com> wrote:
> I have an aspx page with Javascript that shows a message from a hidden
> textbox as shown below.
>
> var vmsg = document.getElementById('txtMsg');
> if (vmsg.value != '') {
> alert(vmsg.value);
> document.getElementById('txtMsg').value = '';
> }
>
> I would like to have the alert box display for 3 seconds and then close. I
> have tried the window.setTimeout with no success. Is there a way to
> accomplish this? Thanks.
>
> David


I think, you can't do this with JavaScript. You can do a hidden div
and show it instead of alert function, like in the example below:

http://forums.tizag.com/archive/index.php?t-961.html

Is there any asp.net solution, e.g. via Ajax popup control or something?
The process I need is on a asp:button click event Thanks.

David


 
Reply With Quote
 
Alexey Smirnov
Guest
Posts: n/a
 
      7th Oct 2009
On Oct 7, 9:17*pm, "David C" <dlch...@lifetimeinc.com> wrote:
> "Alexey Smirnov" <alexey.smir...@gmail.com> wrote in message
>
> news:cb348d3d-50fd-4a69-a963-(E-Mail Removed)...
> On Oct 7, 6:25 pm, "David C" <dlch...@lifetimeinc.com> wrote:
>
> > I have an aspx page with Javascript that shows a message from a hidden
> > textbox as shown below.

>
> > var vmsg = document.getElementById('txtMsg');
> > if (vmsg.value != '') {
> > alert(vmsg.value);
> > document.getElementById('txtMsg').value = '';
> > }

>
> > I would like to have the alert box display for 3 seconds and then close.. I
> > have tried the window.setTimeout with no success. Is there a way to
> > accomplish this? Thanks.

>
> > David

>
> I think, you can't do this with JavaScript. You can do a hidden div
> and show it instead of alert function, like in the example below:
>
> http://forums.tizag.com/archive/index.php?t-961.html
>
> Is there any asp.net solution, e.g. via Ajax popup control or something?
> The process I need is on a asp:button click event Thanks.
>
> David


You can try PopupControl

http://www.asp.net/AJAX/AjaxControlT...upControl.aspx

But asp:button has OnClientClick method which can be used to call
client scripts:

For example:
<asp:Button ... OnClientClick='setTimeout("hidebox()", 5000);'>

Hope this helps
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
How to close an alert box in Internet explorer Carcotton Microsoft Dot NET 0 4th Jun 2008 11:17 AM
How do I get a Desktop Alert stay visible until I close it? =?Utf-8?B?VG9iYmVF?= Microsoft Outlook Discussion 1 19th Sep 2006 05:11 PM
Can't close alert box (resolution issue) Hagrinas Mivali Security and Anti-Spyware Community 4 29th Apr 2005 01:53 AM
Security Alert Window Will Not Close Luluru Spyware Discussion 3 20th Apr 2005 04:49 AM
How to close or disable alert popups Jan Il Spyware Discussion 2 19th Feb 2005 08:55 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:34 PM.