Variable from a Pop Up Window

G

Guest

Hi folks!

I need capture a variable from a pop up window. In a form, when the user
fill all the fields he have an option to insert an obsevation. So he click a
link that open a pop up window with a TextBox web control and after fill it,
by pressing a OK button the context of this text box return to principal
form. Try to use session method without exit.

How can this be done? Can someone provide code to achieve this.

Thanks
 
G

Guest

how are you opening it? If you are using a ShowModalDialog you can catch when
the page returns. Either read the saved value from where you wrote it or pass
it (session variable perhaps) and read it in on the original page.
 
G

Guest

Hi, Curt

Thanks for your reply. I'm opening the pop up window from an simple image
link.
Sorry but don't know about use ShowModalDialog. In the pop up window, when
add the value of the TextBox to a Session, it don't return to the page that
call the pop up. Excuse my English, I'm from Brazil. Thanks in advance.
 
G

Guest

if you are usign window.ShowModalDialog , when OK is clicked assign

window.returnValue = "value from textbox" before closing the window.

in the parent page you would open the window like

var valueFromPopUp = window.ShowModalDialog(.....);

***********************************************
if using window.open ,you can access the textbox in parent form directly
from popup like below..

window.parent.document.forms[0].ParentTextBoxname.value="ValueOfTextBox";
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top