Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Apr 2009
    Posts
    17
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Form Data and iFrames

    I am trying to get around using server side scripting for an issue on a webpage. I have a basic html form like this:
    Code:
    <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:
    Code:
    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.

  • #2
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    simply, no.

  • #3
    Regular Coder
    Join Date
    Apr 2005
    Location
    Texas
    Posts
    448
    Thanks
    24
    Thanked 63 Times in 63 Posts
    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

  • #4
    New Coder
    Join Date
    Apr 2009
    Posts
    17
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Well, that is not what I wanted to hear but it does make sense. Thank you.

  • #5
    Regular Coder
    Join Date
    Sep 2011
    Location
    Sweden
    Posts
    154
    Thanks
    1
    Thanked 22 Times in 22 Posts
    Actually you could use a cloud service as this one to spare you the server side work in a prototype:
    http://jdrop.org/


  •  

    LinkBacks (?)


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •