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 381037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:02:48+00:00 2026-05-12T15:02:48+00:00

if i want to pass in my value for confirmation box!!! so lets say

  • 0

if i want to pass in my value for confirmation box!!! so lets say i want to delete item no 1 so i checked the check box then when i pressed the delete button. the popup box come out with detail item no 1 in it.

i have implemented the popup using show modal dialog (JavaScript) but i still cant get the parent value into the child form!

furthermore if i have item no 1 and item no 2 checked i want both to be displayed in the confirmation box!!

any suggestion would be greatly appreciated thx you!!!

  • 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-05-12T15:02:48+00:00Added an answer on May 12, 2026 at 3:02 pm

    The middle parameter for showModalDialog can be an object or an array or anything you like, and this passed object can be retrieved in the child form (say, in its OnLoad event) by referencing window.dialogArguments.

    Hang on a second and I’ll include a code sample (it’s been about 10 years since I’ve done this).

    Update: here is a very simple code sample that shows the basics of passing data back and forth between the parent and child windows using showModalDialog. Create two HTML files in the same folder, and name them “Parent.htm” and “Child.htm”. Put this code in Parent.htm:

    <HTML>
    <input type=button value="CustomConfirm" 
        onclick="ShowMyDialog()">
    <script language="javascript">
    function ShowMyDialog()
    {
        var obj = new Object(); 
        obj.data1 = 'some data 1';
        obj.data2 = 'some data 2';
        showModalDialog('Child.htm', obj, '');
        alert(obj.returnvalue);
    }
    </script>
    </HTML>
    

    and put this code in Child.htm:

    <HTML>
    <body onload="ReadPassedData()" 
        onunload="DoUnload()">
    <input type=text id="textbox1">
    <br>
    <input type=text id="textbox2">
    <br>
    <br>
    Return value:<br>
    <input type=text id="textbox3" 
        value="type something">
    </body>
    <script language="javascript">
    function ReadPassedData()
    {
        var obj = window.dialogArguments;
        var tb1 = document.getElementById('textbox1');
        tb1.value = obj.data1; 
        var tb2 = document.getElementById('textbox2');
        tb2.value = obj.data2; 
    }
    function DoUnload()
    {
        var obj = window.dialogArguments;
        obj.returnvalue = textbox3.value;
    }
    </script>
    </HTML>
    

    Then open Parent.htm in a browser and click the “CustomConfirm” button. The child window will display the values set in the parent window (“some data 1” and “some data 2”), and when the child window is closed, whatever you’ve entered in the third text box will be displayed in an alert box called from the parent. This shows the basic way in which you pass data to the child and get data back from it.

    There’s also a way to return an object from the child window (which becomes the value returned from the showModalDialog call itself), but I don’t recall how to do this.

    Update 2: To pass an array instead, you would do something like this:

    var myarray = new Array();
    myarray[0] = "Bob Smith";
    myarray[1] = "Doug Jones";
    myarray[2] = "Englebert Humperdinck";
    var ret = showModalDialog('Child.htm', myarray, '');
    alert(ret); // this will display whatever the child set for its
        // window.returnValue
    

    And then in the child window, you would get the array like before and use it to build your details display:

    var myarray = window.dialogArguments;
    alert(myarray[0]); // or whatever
    

    Since you’re now passing in an array instead of an object, you’ll need to return true or false (instead of adding a returnvalue property to the passed object). You set the return value in the child by setting the window.returnValue property. Since you’re creating a confirmation popup, you would presumably have a “Yes” and a “Cancel” button which would set window.returnValue to true or false, respectively.

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

Sidebar

Related Questions

I want to pass value 345 by click on <a> <a class=delete-button' href=/Customer/Delete/345>Delete</a> to
I want to pass in the session scoped the selected radio button value. My
I want to pass a value of an input variable in my program lets
I want to pass a value in a combo box as a param to
On loading the page I want to pass a value to my javascript function
I have this snippet of code below. I want to pass the value of
I want to pass a datetime value into my python script on the command
I want to pass a number value to a Timer. How do I do
I want to pass an ImageIcon instance by value as we know that by
I want to pass HTMLPage as a return value of my WCF REST Service

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.