[Webinar] Streamline your web hosting managementRegister Today


Pass Variable to Pop-up window

Posted on 2004-11-28
Medium Priority
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

ID: 12692294
LVL 49

Expert Comment

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

Author Comment

ID: 12695652
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 ?
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

LVL 49

Expert Comment

ID: 12695910
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

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


Accepted Solution

prsupriya earned 2000 total points
ID: 12701746
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="popwin.xxx?st=1&stext=blah1 blah1 blah1 blah1" target="_blank">Statement1:</a> blah1 blah1 blah1 blah1<bR><bR>

<a href="popwin.xxx?st=2&stext=blah2 blah2 blah2 blah2"  target="_blank">Statement2:</a> blah2 blah2 blah2 blah2<bR><bR>

<a href="popwin.xxx?st=3&stext=blah3 blah3 blah3 blah3"  target="_blank">Statement3:</a> blah3 blah3 blah3 blah3<bR><bR></form>

In popwin.xxx you can write

<form action="popwin.xxx" method="post">
      <input type="text" value="url.stext" name="st1"><br>
      <input type="hidden" value="stid" name="url.st">
      <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

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Advertising is a powerful thing. The important question is, how to create advertisement people would willingly want to share on their social media? This article gives you essential tips on how to launch successful viral ad and increase substantially…
There is a wide range of advantages associated with the use of ASP.NET. This is why this programming framework is used to create excellent enterprise-class websites, technologies, and web applications.
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.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses
Course of the Month10 days, 20 hours left to enroll

612 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