By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,730 Members | 1,648 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,730 IT Pros & Developers. It's quick & easy.

passing data from a child window to different textboxes of its parent

P: 92
What I want to do is be able to open a popup window that may pass data to different rows of textboxes of its parent window.

I want to pass data to different rows of textboxes and each row has a different set of values. How can I do it? Through a function? Through conditional statements? Through creating one popup window for each row of textboxes?

I really need an answer ASAP. thanks.
Oct 8 '07 #1
Share this Question
Share on Google+
6 Replies


dmjpro
100+
P: 2,476
What I want to do is be able to open a popup window that may pass data to different rows of textboxes of its parent window.

I want to pass data to different rows of textboxes and each row has a different set of values. How can I do it? Through a function? Through conditional statements? Through creating one popup window for each row of textboxes?

I really need an answer ASAP. thanks.
You can access the parent window variables using .............

Expand|Select|Wrap|Line Numbers
  1. opener....................
  2.  
Debasis Jana
Oct 8 '07 #2

P: 92
You can access the parent window variables using .............

Expand|Select|Wrap|Line Numbers
  1. opener....................
  2.  
Debasis Jana
What I want to do is pass values to different text boxes. like that of a tigra javascript popup calendar.
Oct 9 '07 #3

dmjpro
100+
P: 2,476
What I want to do is pass values to different text boxes. like that of a tigra javascript popup calendar.
Parent page Scripting.
Expand|Select|Wrap|Line Numbers
  1. var ref = window.open(....); //this is the child window
  2. .
  3. .
  4.  
Child page Scripting.
Expand|Select|Wrap|Line Numbers
  1. opener.document.forms["form_name"].elements["element_name"].value = document.forms["form_name"].elements["element_name"].value
  2. //you are assigning here child value to parent value.
  3.  
Enjoy the code.

Debasis Jana
Oct 9 '07 #4

P: 92
Parent page Scripting.
Expand|Select|Wrap|Line Numbers
  1. var ref = window.open(....); //this is the child window
  2. .
  3. .
  4.  
Child page Scripting.
Expand|Select|Wrap|Line Numbers
  1. opener.document.forms["form_name"].elements["element_name"].value = document.forms["form_name"].elements["element_name"].value
  2. //you are assigning here child value to parent value.
  3.  
Enjoy the code.

Debasis Jana
I meant passing different sets of values for different rows of textboxes.

say for example, I want to pass item_code, description, and price to textbox set 1. and a different item_code, description, and price to the next row of textbox. How should it be done?
Oct 9 '07 #5

dmjpro
100+
P: 2,476
I meant passing different sets of values for different rows of textboxes.

say for example, I want to pass item_code, description, and price to textbox set 1. and a different item_code, description, and price to the next row of textbox. How should it be done?
Post your code you tried so far.

Debasis Jana
Oct 9 '07 #6

P: 92
Could you kindly tell me how I can use a much simpler code than having to do this:

Expand|Select|Wrap|Line Numbers
  1. if(self.opener.document.form1.item_code1.value==""){
  2. self.opener.document.form1.item_code1.value=document.form1.item_code.options.[document.form1.item_code.selectedIndex].value;
  3. self.opener.document.form1.description1.value=document.form1.description.options.[document.form1.item_code.selectedIndex].value;
  4. }
  5. else
  6. {
  7. if(self.opener.document.form1.item_code1.value!="" && self.opener.document.from1.item_code2.value==""){
  8. self.opener.document.form1.item_code2.value=document.form1.item_code.options.[document.form1.item_code.selectedIndex].value;
  9. self.opener.document.form1.description2.value=document.form1.description.options.[document.form1.item_code.selectedIndex].value;
  10. }
  11. }
  12.  
Oct 11 '07 #7

Post your reply

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