We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Pass value from parent form to child form and get this back when i refresh the parent form. How do i do it?

casstd
casstd asked
on
Medium Priority
2,831 Views
Last Modified: 2007-12-19
Hi,

           I have parent and child form. I allow the user to update information in the child form. I update different table using child form and display information from this table(Paperspublished) in the main form. This is related by the memberID.    

   I close the popup window and refresh the main form to display the information that is updated in the child window.  I have 2 textarea boxes and 2 text boxes.

When i refresh the parent form i don't want to loose the information in the boxes so i want to get these form values in child window and from the child window i want to get this back when i refresh the parent window.

I want to refresh the parent form which is important. As the main form is a edit form that has information in the parent form.

For example:

Response.Write "<textarea name=Description cols=80 rows=10 id=Description>"&rs(server.HTMLEncode("Description"))&"</textarea></td>"

Response.Write "<textarea name=Experience cols=80 rows=10>"&rs(server.HTMLEncode("Experience"))&"</textarea></td>"


How do i get this value in child form and get this back in parent window?


Comment
Watch Question

if the values that you pass back are put into a form on the parent page, then when you refresh you should be able to access them from Request.Form("name").
as for passing values back to parent look at this question

https://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_20941126.html
ZvonkoSystems architect
CERTIFIED EXPERT
Top Expert 2006

Commented:
please delete the other duplicate window: http:Q_20943524.html
When some expert posts a comment in that question, then you will have to ask the Community Support for question deltion.
ZvonkoSystems architect
CERTIFIED EXPERT
Top Expert 2006

Commented:
I understood your question in that way, that you want to know how to transfer the textarea value from parent to child popup window, right?
Ok, the popup uses this to get parent textarea value:
<body>
<form>
<textarea name=Description cols=80 rows=10 id=Description>
</textarea>
<textarea name=Experience cols=80 rows=10>
<textarea>
<input type=submit>
</form>
<script>
theForm=document.forms[0];
openerForm=opener.document.forms[0];
theForm.Description.value=openerForm.Description.value;
theForm.Experience.value=openerForm.Experience.value;
</script>
</body>

That will load the parent textarea values in child popup form textareas.
To refresh the opener you have to send this script as form submission Response:
<script>
opener.location.reload(true);
window.close();
</script>


That will reload the updated parent form and close the child popup window.


Commented:
Hi Zvonko,
   
             I pass the parent form value to child becuase when i close popup and refresh the parent i want to get this back. The other parent form value i sent through querystring and convert to session variable in popup window.

           I face the problem in textarea. that has lot of information in it. So i could not send this through querystring.

That is why some way i want to get back my textarea value when i reload it. The other parent form value i convert to session for textarea i struct to get it back in the parent.

I want some way to get back the textarea value when i reload it. I don't use this textarea information in my popup.

Could you please help me how do i do it.



ZvonkoSystems architect
CERTIFIED EXPERT
Top Expert 2006

Commented:
Are you casstd?

Author

Commented:
Hi Zvonko,

               We are working together to solve this issue. So don't mistake us. Could you please help me to solve this?

Thank you.

Author

Commented:
Hi,

       I have created a dumy form in the parent window. I have all hidden fields similar to parent window and i submit this form when i open child window. When i submit the dumy form in back i convert all the form values to session variable and get this back in Parent form.


Thank you all for your help.


Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.