473,385 Members | 1,370 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to get values from a pop up window

Dear Sir/madam

I have button and when i click that button a pop up window will come.On that pop up window i will select a product type.But what i want now is how to get that selected product type to textbox in main page when i click ok on pop up window

Please help me
Feb 7 '07 #1
2 2016
scripto
143 100+
you will need (javascript) something like this:

function myClick()
{
var popupCtrl = document.getElementById('popupControl');
var parentTextbox = window.parent.document.getElementById('parentTextb ox');

if (popupCtrl != null)
{
parentTextbox .innerText = popupCtrl .innerText;
}
else
{
alert('please enter a value');

}

window.close();
}
Feb 7 '07 #2
jhardman
3,406 Expert 2GB
I've done something similar. I couldn't find the parent page, but the code on the pop up looked like this:
Expand|Select|Wrap|Line Numbers
  1. function send() {
  2.    window.opener.document.all.<%=request("box")%>.style.background = colorpicker;
  3.    window.opener.change_color(<%=right(request("box"),1)%>,colorpicker)
  4.    window.close();
  5.  
  6. }
  7.  
The code sends a color picked in the pop-up window to be a new background color for some object in the parent window (sent to the popup window as "box"). I can't remember what the change_color function does. but if you wanted to pass the value from the popup to a textfield, the code should be:
Expand|Select|Wrap|Line Numbers
  1. function send() {
  2.    window.opener.document.all.text1.value = popUpValue;
  3.    window.close();
  4.  
  5. }
  6.  
I hope my javascript syntax is passable.
Feb 8 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Bhavin G | last post by:
Hi there , I am pretty new at javascripting and i am having this huge problem. I am using asp.net and C# webapplication. In my asp.net aspx file I have a place holder for taking an html table...
4
by: news.microsoft.com | last post by:
Hi, In the debug Auto and Locals window the value that has changed becomes highlighted in red, BUT the Watch window does no highlighting, why the inconsistency? Would it not be better if this...
2
by: Brian Henry | last post by:
If i have a window showing like this <script>window.showModalDialog('../weblinks/default.aspx','','unadorned:yes' );</script> how can i get it to return a value to its calling page? I want to...
3
by: User | last post by:
Form A (Main) Text Box 1 Text Box 2 Text Box 3 Form B (Pop-up) Choose a selection for Form A/Text Box 3 Scenario:
0
by: Peter | last post by:
Does any one has an example of how do I retrieve values from a PopUp Window. The popup windows is an ASP.NET webform and it is displayed when user clicks on a html button. How do I retrieve...
0
by: ssrivani | last post by:
hi all, I have a parent window default.aspx which has a textbox(txtBox1) with multiline property and a button.when the button is clicked a child window pops up child.aspx. I have four textboxes...
6
by: vncntj | last post by:
I have this home.js file and I'm trying to collect the values on the other at "emplist.aspx" function poponload() { testwindow= window.open ("emplist.aspx", "mywindow",...
1
by: pingalkar | last post by:
Hi, In my application, I call one popup winodow by using this link.. <a href="#" onClick="return showWindow('1','XYZ');"> <img src="images/magnifier.gif" ALT="Chemicals"...
1
by: srinivasyadavkota | last post by:
Hi Experts here, Pls help. In my WebApplication from Home page(i.e parent window) i am sending the values to child window(i.e popup page) In the popup page(i.e child window) I am storing the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.