Popup Receives Form Data

[Total: 0    Average: 0/5]

This will take the data in the form and place it on the new popup window.

Head Code:

<script language = "JavaScript"> 
<!-- 
function create(_f) { 
  storywin = window.open(); 
  with (storywin.document)
  { 
    if(_f.sec1.value)
      writeln ("<h2>Items One:</h2><BR> " + _f.sec1.value + "<br><br>"); 
    if(_f.sec2.value)
      writeln ("<h2>Items Two:</h2><BR> " + _f.sec2.value + "<br><br>"); 
  } 
} 
// --> 
</script> 

Body Code:

<h1>Two Lists</h1> 
<form> 
  <h2>Section One: </h2> 
  <BR><textarea name="sec1" cols="75" rows="10"></textarea> 
  <BR>
  <h2>Section Two:</h2> 
  <BR><textarea name="sec2" cols="75" rows="5"></textarea> 
  <BR><input type = "button" value="Generate Popup" onClick = "create(this.form)" name="button"> 
  <BR><input type="reset" name="Reset" value="Clear Form"> 
</form> 

Times Viewed: 3

Leave a Reply

Your email address will not be published. Required fields are marked *