javascripts-form objects. problem to connect display1 and display2

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aieaddin94
    New Member
    • Apr 2014
    • 1

    javascripts-form objects. problem to connect display1 and display2

    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

    Code:
     function display1()
    	   {
    
                 var new_win = window.open();
    
                 /******** Sub-section for step 2 - Text Field *********/
                 var name = document.form1.person_name.value;
    
                 new_win.document.writeln("Name: <b>", name, "</b><br>");
    
                 /********* Sub-section for step 3 - Radio *********/
                 btn_array = document.form1.own_computer;
    
                 if (btn_array[0].checked)
                   new_win.document.writeln("Have a computer: <b> YES </b>", "<br>");
                 else
                    if (btn_array[1].checked)
                        new_win.document.writeln("Have a computer: <b> NO </b>", "<br>");
    
                 /********* Sub-section for step 4 - List *********/
                 list = document.form1.computer_type;
                 index =list.selectedIndex;
                 comp_type=list.options[index].text;
    
                 new_win.document.writeln("Computer Type: <b>", comp_type, "</b><br>");
    
                 /********* Sub-section for step 5 - Check Box *********/
                 check_array = document.form1.language;
                 new_win.document.writeln("Computer Languages: <b>");
    
                 for (var i=0; i<document.form1.language.length; i++)
                 {
                   if (document.form1.language[i].checked)
                       new_win.document.writeln(check_array[i].value,", *");
                 }
                 new_win.document.writeln("</b>");
    		   }
    
    	     function display2()
    	     {
    	        document.form1.text1.value = "any text" ;
    	     }
    Last edited by Rabbit; Apr 15 '14, 03:19 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
Working...