-1

While this code does work, I want to be able to transfer the code to a different html page when the user clicks submit after filling out the form.

<HTML>
<HEAD>
<TITLE>Test Input</TITLE>
<STYLE>
body {
    background-color: #2C2F33
}
.form {
    font-family: Arial;
    color: #FFFFFF
}
.
</STYLE>
<SCRIPT>
function testResults (form) {
    var Name = form.Name.value;
     var Bio = form.Bio.value;
    document.write (Name);
     document.write("<br>");
     document.write (Bio);
}
</SCRIPT>
</HEAD>
<BODY>
<DIV CLASS="FORM">
<FORM NAME="myform" ACTION="" METHOD="GET" >What is your name? This can be your first name, or an alias your known by. <BR>
<INPUT TYPE="text" NAME="Name" VALUE="" STYLE="height: 50px; width: 400px;"><P>
<FORM NAME="myform" ACTION="" METHOD="GET">Who are you? What do you do? <BR>
<INPUT TYPE="text" NAME="Bio" VALUE="" STYLE="height: 200px; width: 400px;"><P>
<div class="">
<INPUT TYPE="button" NAME="button" Value="Submit" onClick="testResults(this.form)">
</div>
</FORM>
</DIV>
</BODY>
</HTML>

Can anyone please tell me how to achieve this? I've tried making another html page then writing the info, but it doesn't work.

Side note, yes there is some code that isn't filled out

1BL1ZZARD
  • 225
  • 2
  • 14
  • 3
    Does this answer your question? [How to pass data from one page to another page html](https://stackoverflow.com/questions/36599781/how-to-pass-data-from-one-page-to-another-page-html) or this: https://stackoverflow.com/questions/11609376/share-data-between-html-pages or this: https://stackoverflow.com/questions/17502071/transfer-data-from-one-html-file-to-another Theres more of that around here or on google – ikiK Apr 16 '21 at 23:08

1 Answers1

-1

The action property specifies which page it is sent to. Right now it is blank and won't send to another page, even if all the other mark-up was correct. There are many ways to achieve what you are trying to do. This is only one aspect to consider initiallly.

nooby
  • 87
  • 7