Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

alertbox javascript

Options
  • 23-11-2006 11:39am
    #1
    Registered Users Posts: 597 ✭✭✭


    Hello all,

    Anyone know how to open an alert box so that it apears over everything on the screen? Is it setFocus or something?

    With the code below, the form submission activates a download window, and also after a slight delay, opens another alert box. This alertbox is appearing behind the download box so users can't see it. any ideas how to have it appear over the download box?
    <script type="text/javascript">
    function promptThirtyFree()
    
    	{
    	var answer = confirm ("While you wait, please click OK to blah blah")
    	if (answer)
    		{
    		window.open ("https://www.site.com/usd/","_Blank","scrollbars=yes,width=803,height=560"); 
    		
    		}
    	}
    </script>
    
    <form name="frmDownload"
    action="SmartDownload.asp" method=post onsubmit="setTimeout('promptThirtyFree();',6000)">
    <input type="hidden" name="filename" value="SmartDownload.exe">
    <input name="download" type="image" src="images/downloadPic.gif" width="519" height="174" border="0">
    

    Thanks


Comments

  • Registered Users Posts: 21,257 ✭✭✭✭Eoin


    yeraulone wrote:
    Hello all,

    Anyone know how to open an alert box so that it apears over everything on the screen? Is it setFocus or something?

    With the code below, the form submission activates a download window, and also after a slight delay, opens another alert box. This alertbox is appearing behind the download box so users can't see it. any ideas how to have it appear over the download box?
    <script type="text/javascript">
    function promptThirtyFree()
    
    	{
    	var answer = confirm ("While you wait, please click OK to blah blah")
    	if (answer)
    		{
    		window.open ("https://www.site.com/usd/","_Blank","scrollbars=yes,width=803,height=560"); 
    		
    		}
    	}
    </script>
    
    <form name="frmDownload"
    action="SmartDownload.asp" method=post onsubmit="setTimeout('promptThirtyFree();',6000)">
    <input type="hidden" name="filename" value="SmartDownload.exe">
    <input name="download" type="image" src="images/downloadPic.gif" width="519" height="174" border="0">
    

    Thanks

    Does that code not make the confirmation box pop up after 6 seconds, and if the user clicks OK, then shows the popup?


  • Registered Users Posts: 597 ✭✭✭yeraulone


    eoin_s wrote:
    Does that code not make the confirmation box pop up after 6 seconds, and if the user clicks OK, then shows the popup?

    once the user submits the form, the alert box is set to open after 6 seconds. I'm trying to place this alertbox to the front of the screen, so its viewable.


  • Registered Users Posts: 21,257 ✭✭✭✭Eoin


    yeraulone wrote:
    no - once the user submits the form, the alert box is set to open after 6 seconds. I'm trying to place this alertbox to the front of the screen, so its viewable.

    That's what I said.

    Your code seems to do the following:

    1) User submits form
    2) Nothing happens for 6 seconds (??)
    3) If user clicks OK on the confirm (not alert) box , then the popup window is opened

    Am I missing something?


  • Registered Users Posts: 597 ✭✭✭yeraulone


    eoin_s wrote:
    That's what I said.

    Your code seems to do the following:

    1) User submits form
    2) Nothing happens for 6 seconds (??)
    3) If user clicks OK on the confirm (not alert) box , then the popup window is opened

    Am I missing something?

    yes - the user does not have to click ok for the alertbox to open. sorry - I should have said that.


  • Registered Users Posts: 21,257 ✭✭✭✭Eoin


    yeraulone wrote:
    yes - the user does not have to click ok for the alertbox to open. sorry - I should have said that.

    I think there is a bit of confusion about terminology here.

    You don't have any alert box in your code at all. You have a confirmation box and a popup window.

    Your code will only open the popup window if OK is pressed as it is looking for a "true" result to open the popup. If Cancel is pressed, then your "answer" variable will be false, so the window won't open.

    Do you want to have an alert box that appears immediately, and then a popup window 6 seconds after the user clicks OK?


  • Advertisement
Advertisement