Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-27-2011, 02:11 PM   PM User | #1
mikemcg36
New Coder

 
Join Date: Apr 2009
Posts: 17
Thanks: 1
Thanked 0 Times in 0 Posts
mikemcg36 is an unknown quantity at this point
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.
mikemcg36 is offline   Reply With Quote
Old 09-27-2011, 03:20 PM   PM User | #2
DanInMa
Senior Coder

 
DanInMa's Avatar
 
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,307
Thanks: 12
Thanked 204 Times in 204 Posts
DanInMa is on a distinguished road
simply, no.
__________________
- Firebug is a web developers best friend! - Learn it, Love it, use it!
- Validate your code! - JQ/JS troubleshooting
- Using jQuery with Other Libraries - Jslint for Jquery/other JS library users
DanInMa is offline   Reply With Quote
Old 09-27-2011, 03:31 PM   PM User | #3
blaze4218
Regular Coder

 
Join Date: Apr 2005
Location: Texas
Posts: 448
Thanks: 24
Thanked 63 Times in 63 Posts
blaze4218 is an unknown quantity at this point
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
blaze4218 is offline   Reply With Quote
Old 09-27-2011, 03:47 PM   PM User | #4
mikemcg36
New Coder

 
Join Date: Apr 2009
Posts: 17
Thanks: 1
Thanked 0 Times in 0 Posts
mikemcg36 is an unknown quantity at this point
Well, that is not what I wanted to hear but it does make sense. Thank you.
mikemcg36 is offline   Reply With Quote
Old 09-27-2011, 06:44 PM   PM User | #5
ironboy
Regular Coder

 
Join Date: Sep 2011
Location: Sweden
Posts: 154
Thanks: 1
Thanked 22 Times in 22 Posts
ironboy is an unknown quantity at this point
Actually you could use a cloud service as this one to spare you the server side work in a prototype:
http://jdrop.org/
ironboy is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:36 AM.


Advertisement
Log in to turn off these ads.