Pass Variable to Pop-up window

Posted on 2004-11-28
Last Modified: 2013-11-28
Hello, I will try to give a detailed description of what I am looking to do...Hopefully someone can steer me in the right direction.

I have a .asp page that returns results from a database.  Basically, it is a bunch of short statements.  Each 'field' in the database is a short statement.  There are approx 10 short statements in each Query that is returned on this page.

Example: page returns this type of information

Statement1: blah blah blah blah

Statement2: blah blah blah blah

Statement3: blah blah blah

Now what I would like to do, is to have the user be able to click on the statement details for each statement and have a pop-up window open up where they can be presented with the text in a textbox.  From there, they will be able to modify the text as they see fit. Then, close the pop-up window box and have the original page return the new results.

Can someone help me with this ?  I am sure that this is possible, but i have yet to figure out how.

Thank you in advance for your help
Question by:Banbear
    LVL 18

    Expert Comment

    LVL 49

    Expert Comment

    Why using a difficult popup kind of mechanism and not just use a textfield in the firstplace?

    Author Comment

    Thanks for the reply's.... The text is from the database.

    You see, the user is selecting from several different already pre-setup responses.  The user selects the 'response plan' that fits their needs.  It will come with a prefilled text, however, they will have the option to modify the text as necessary.  

    What I would like to do, is to have the pop-up window show the pre-filled text in a textbox, then the user can make the changes as they see fit.  Once they make their changs, they will click the "close window" button and that will return them to the parent window.  The parent window will now display the new edited text.

    make sense ?
    LVL 49

    Expert Comment

    Easiest would be when each text has an associated unique id at database level. You would then just have some popup which is called like popupedit.php?editid=UNIQUE_ID or popupedit.asp?editid=UNIQUE_ID.

    popupedit then reads the text from database, and does the writeback to the database.

    Often this just involves a <form method="post"> at the popup. When you receive a submitted form you would just output an additional javascript block which says:
    <script type="text/javascript">window.opener.location.href = window.opener.location</script>
    This forces the parent window to reload after some new value has been inserted into the database.



    Author Comment

    i have increased the points value to see about getting some much needed assistance.

    LVL 5

    Accepted Solution

    As your statement text is not too long, you can pass the text to the pop up window like this.

    <form name="frm1" method="post">
    <a href=" blah1 blah1 blah1" target="_blank">Statement1:</a> blah1 blah1 blah1 blah1<bR><bR>

    <a href=" blah2 blah2 blah2"  target="_blank">Statement2:</a> blah2 blah2 blah2 blah2<bR><bR>

    <a href=" blah3 blah3 blah3"  target="_blank">Statement3:</a> blah3 blah3 blah3 blah3<bR><bR></form>

    In you can write

    <form action="" method="post">
          <input type="text" value="url.stext" name="st1"><br>
          <input type="hidden" value="stid" name="">
          <input type="submit" value="Submit" name="submit">

    Insert the updated value into the database with the posted stid as a reference id and at the end of the page write <script> window.opener.document.location.reload();
    self.close();</script> to refresh the main window.

    Hope this helps.

    Featured Post

    Live: Real-Time Solutions, Start Here

    Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

    Join & Write a Comment

    Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
    For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
    The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
    Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now