SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Troubles with confirm box

    I have a small script that I want to use to decide on whether or not to run something.

    It works fine except the page loads fully (though doesn't display full) before action is taken. Here's everything:
    Code:
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" errorPage="/config/include/error.jsp"%>
    <html>
    <head>
    <title>Edit User</title>
    <link rel="stylesheet" type="text/css" href="/redi/inc/style/redi.css">
    <script language="JavaScript" type='text/javascript'>
    <!--
    function confirmEntry()
    {
    	 input_box = confirm("Are you sure you want to run the Fix Server Status with Enviroment function?" );
    	 if(input_box == false)
    	 { 
    		  history.back(-1);
    	 }
    }
    // -->
    </script>
    </head>
    <body bgcolor="#CCCCCC" text="#666666" link="#003366" vlink="#003366" alink="#003366">
    <script type='text/javascript'>confirmEntry(); </script>
    <%
    path.to.my.package cleanup = new path.to.my.package();
    out.println("<center>" + cleanup.resetDatabaseStatusCode() + "</center>" );
    %>
    </body>
    </html>
    I have a feeling this is going to get a lot more complicated than I would like. [img]images/smilies/smile.gif[/img]
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  2. #2
    011521 dbalsdon's Avatar
    Join Date
    Feb 2003
    Location
    North Of Scotland
    Posts
    444
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    put
    Code:
    <script type='text/javascript'>confirmEntry(); </script>
    into your head tags..
    Daniel Balsdon
    My Site

  3. #3
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hrm... it stopped html display, but the JSP call still executed. (It runs a method that'll send a mail, and I still get the mail.)
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  4. #4
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nevermind, I've resolved this issue.
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •