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

javascripts-form objects. problem to connect display1 and display2

aieaddin94
P: 1
how to get the output from function display1 to function display2 where display1 output is display in new window and display2 output is display in text area

Expand|Select|Wrap|Line Numbers
  1.  function display1()
  2.        {
  3.  
  4.              var new_win = window.open();
  5.  
  6.              /******** Sub-section for step 2 - Text Field *********/
  7.              var name = document.form1.person_name.value;
  8.  
  9.              new_win.document.writeln("Name: <b>", name, "</b><br>");
  10.  
  11.              /********* Sub-section for step 3 - Radio *********/
  12.              btn_array = document.form1.own_computer;
  13.  
  14.              if (btn_array[0].checked)
  15.                new_win.document.writeln("Have a computer: <b> YES </b>", "<br>");
  16.              else
  17.                 if (btn_array[1].checked)
  18.                     new_win.document.writeln("Have a computer: <b> NO </b>", "<br>");
  19.  
  20.              /********* Sub-section for step 4 - List *********/
  21.              list = document.form1.computer_type;
  22.              index =list.selectedIndex;
  23.              comp_type=list.options[index].text;
  24.  
  25.              new_win.document.writeln("Computer Type: <b>", comp_type, "</b><br>");
  26.  
  27.              /********* Sub-section for step 5 - Check Box *********/
  28.              check_array = document.form1.language;
  29.              new_win.document.writeln("Computer Languages: <b>");
  30.  
  31.              for (var i=0; i<document.form1.language.length; i++)
  32.              {
  33.                if (document.form1.language[i].checked)
  34.                    new_win.document.writeln(check_array[i].value,", *");
  35.              }
  36.              new_win.document.writeln("</b>");
  37.            }
  38.  
  39.          function display2()
  40.          {
  41.             document.form1.text1.value = "any text" ;
  42.          }
Apr 15 '14 #1
Share this question for a faster answer!
Share on Google+

Post your reply

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