View Full Version : Form Data and iFrames

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:

<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)">

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.

09-27-2011, 03:20 PM
simply, no.

09-27-2011, 03:31 PM
You can't access data from multiple users without server side code. Each user can only affect what is happening in their browser on their computer.
Even a "simulation" of writing to the server from multiple users would require accessing the global application variable (i.e. global.asa in asp) which would still require sever side scripting :(

09-27-2011, 03:47 PM
Well, that is not what I wanted to hear but it does make sense. Thank you.

09-27-2011, 06:44 PM
Actually you could use a cloud service as this one to spare you the server side work in a prototype: