mikemcg36
09-27-2011, 02:11 PM
I am trying to get around using server side scripting for an issue on a webpage. I have a basic html form like this:
<html>
<body>
<FORM NAME="myform" ACTION="" METHOD="GET">Enter something in the box: <BR>
<INPUT TYPE="text" NAME="inputbox" VALUE=""><P>
<INPUT TYPE="button" NAME="button" Value="Click" onClick="testResult (this.form)">
</body>
</html>
I know I can use JavaScript to capture the data like this:
function testResults (form) {
var TestVar = form.inputbox.value;
alert ("You typed: " + TestVar);
}
Instead of alerting it, can I save the data in an iframe? Will it stay there once they leave the page? I want the iframe to eventually contain info from lots of people's answers.
I am wanting to simulate saving the answers to a text file on the server.
<html>
<body>
<FORM NAME="myform" ACTION="" METHOD="GET">Enter something in the box: <BR>
<INPUT TYPE="text" NAME="inputbox" VALUE=""><P>
<INPUT TYPE="button" NAME="button" Value="Click" onClick="testResult (this.form)">
</body>
</html>
I know I can use JavaScript to capture the data like this:
function testResults (form) {
var TestVar = form.inputbox.value;
alert ("You typed: " + TestVar);
}
Instead of alerting it, can I save the data in an iframe? Will it stay there once they leave the page? I want the iframe to eventually contain info from lots of people's answers.
I am wanting to simulate saving the answers to a text file on the server.