Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8640153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:12:37+00:00 2026-06-12T11:12:37+00:00

I have a jsp file which calls another jsp file opening it as a

  • 0

I have a jsp file which calls another jsp file opening it as a showmodal dialog window.

Say file1.jsp calls file2.jsp through file1.js.

File1.jsp–>File1.js (respective js files)
File2.jsp–>File2.js(respective js files)

Now to handleonclose in File2.jsp I added a function in File2.js.

When I hit close window but choose option as cancel, instead of just showing the old window.
It shows a modal window ontop of the existing modal window. Why is this happening. Am I missing something obvious.

What i expect to happen: When I choose Close but click cancel, nothing should happen.

File2.js function:

function handleOnClose() {

    var resultsDoc = document.frames('searchBuffer').document;

    if (event.clientY < 0) {
        var bool = confirm('Are you sure you want to close the window ?');
        if (!bool) { //Issue occurs here
            window.showModalDialog("File2.jsp", "", "dialogWidth:1000px;dialogHeight:650px");
        }
        else {
            resultsDoc.all('searchResults').innerText = '';

            document.someSearch.submit();
        }
    }

    window.returnValue = 'Discard';

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T11:12:38+00:00Added an answer on June 12, 2026 at 11:12 am

    Modified File2.js function:

    function handleOnClose() {
    
        var resultsDoc = document.frames('searchBuffer').document;
    
        if (event.clientY < 0) {
            var bool = confirm('Are you sure you want to close the window ?');
            if (!bool) { //Issue occurs here
                //*******removed the showmodal dialog window call
                  window.returnValue = 'Sorry';
            }
            else {
                resultsDoc.all('searchResults').innerText = '';
    
                document.someSearch.submit();
        window.returnValue = 'Discard';
            }
        }
    
    }
    

    On the calling js (file1.js) I check if return value is “Discard” if so I refresh the page.
    Otherwise I call the showmodal window again. My result is stored in the buffer so retrieval isn’t a problem. Works like a charm

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a web project using jsp, I have following requirement Upload a file (say
I have a JSP file which creates an Excel document. I want to dynamically
I have a JSP file Signup.jsp which submits to UserDetails servlet which inserts the
I have a form in a jsp file, which I have used to get
I have following piece of code in my jsp file which getSession information: <jsp:useBean
I have a jsp file which contain javascript functions at top of file. These
I have created a child.jsp file which has a button named Continue. I have
I've got a jsp file, which includes another jsp file to check some values
I have a JSP file in which I have an entity class - I
I get the strangest thing going on... I have a JSP file which read

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.