473,396 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Can you save form data to the website?

In my website i have forms that are submitted into the URL and then converted into javascript on the next page, i wish to have sort of like a survey on the first page and then she the results of others on the next, is their anyway of storing javascript variables into an html file, my web hosting doesn't allow anything else and doesn't allow the post method (webs.com) If its not possible can someone explain a way to do it in notepad?

also the email form code also brings up windows live mail and the form data doesn't even appear in the message is the a way to email form data just from the website?






if it will help heres the codes for both my pages

index.htm
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head></head>
  3. <body onload="message()">
  4.  
  5. <div style="position:absolute;top:10px;left:50px" >
  6.  
  7. <form name="input" action="index2.htm" method="get">
  8. Name: <input type="text" name="user" /> <br />
  9. Age:   <input type="number" name="age" min="1" max="120" /> <br />
  10. E-mail: <input type="email" name="email" /> <br />
  11. <input type="radio" name="sex" value="male" /> Male<br />
  12. <input type="radio" name="sex" value="female" /> Female <br />
  13. <input type="checkbox" name="bike" value="Yes" /> I have a bike<br />
  14. <input type="checkbox" name="car" value="Yes" /> I have a car <br />
  15.  
  16. <input type="submit" value="Submit" />
  17.  
  18. </form>
  19.  
  20.  
  21. <noscript></noscript><!-- --><script type="text/javascript" src="http://www.freewebs.com/p.js"></script><script type="text/javascript">
  22.  
  23.  
  24.  
  25.  
  26. if (localStorage.pagecount2)
  27.     {
  28.     localStorage.pagecount2=Number(localStorage.pagecount2) +1;
  29.     }
  30. else
  31.     {
  32.     localStorage.pagecount2=1;
  33.     }
  34. document.write(<br /> + "You've been on this page " + localStorage.pagecount2 + " time(s)");
  35.  
  36.  
  37.  
  38.  
  39. </script>
  40.  
  41.  
  42.  
  43. </div>
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51. </body>
  52. </html>
  53.  
index2.htm
Expand|Select|Wrap|Line Numbers
  1.  
  2. <html>
  3. <head>
  4. </head>
  5. <body>
  6.  
  7.  
  8.  
  9. <noscript></noscript><!-- --><script type="text/javascript" src="http://www.freewebs.com/p.js"></script><script type="text/javascript">
  10.  
  11.  
  12. function querySt(ji) {
  13. hu = window.location.search.substring(1);
  14. gy = hu.split("&");
  15. for (i=0;i<gy.length;i++) {
  16. ft = gy[i].split("=");
  17. if (ft[0] == ji) {
  18. return ft[1];
  19. }
  20. }
  21. }
  22.  
  23.  
  24.  
  25.  localStorage.sex = querySt("sex");
  26.  localStorage.car = querySt("car");
  27.  localStorage.bike = querySt("bike");
  28.  localStorage.user = querySt("user");
  29.  localStorage.age = querySt("age");
  30.  localStorage.email = querySt("email");
  31.  
  32.  
  33.  
  34.      var strReplaceAll =  localStorage.user;
  35.      var intIndexOfMatch = strReplaceAll.indexOf( "+" );
  36.  
  37.      // Loop over the string value replacing out each matching
  38.      // substring.
  39.      while (intIndexOfMatch != -1){
  40.      // Relace out the current instance.
  41.      strReplaceAll = strReplaceAll.replace( "+", " " )
  42.  
  43.      // Get the index of any next matching substring.
  44.      intIndexOfMatch = strReplaceAll.indexOf( "+" );
  45.      }
  46.  
  47.  
  48.      localStorage.user = strReplaceAll;
  49.  
  50.  
  51.  
  52.  
  53.  
  54.      var strReplaceAlla   =  localStorage.email;
  55.      var intIndexOfMatcha = strReplaceAlla.indexOf( "%40" );
  56.  
  57.      // Loop over the string value replacing out each matching
  58.      // substring.
  59.      while (intIndexOfMatcha != -1){
  60.      // Relace out the current instance.
  61.      strReplaceAlla = strReplaceAlla.replace( "%40", "@" )
  62.  
  63.      // Get the index of any next matching substring.
  64.      intIndexOfMatcha = strReplaceAlla.indexOf( "%40" );
  65.      }
  66.  
  67.  
  68.      localStorage.email = strReplaceAlla;
  69.  
  70.  
  71.  
  72.  
  73.  
  74. document.write( localStorage.user+" is "+localStorage.sex+" and "+localStorage.age+" years old. His/Her email is "+ localStorage.email);
  75.  
  76.  
  77.  
  78.  
  79.  
  80. -->
  81. </script>
  82.  
  83.  
  84.  
  85. </body>
  86. </html>
  87.  
Jan 13 '11 #1

✓ answered by AutumnsDecay

I'd change hosts, personally, especially if you're using their free package of hosting.

You can find basic PHP enabled hosting plans for like, $1/mo

1 3187
AutumnsDecay
170 100+
I'd change hosts, personally, especially if you're using their free package of hosting.

You can find basic PHP enabled hosting plans for like, $1/mo
Jan 13 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: mehlin | last post by:
I am a novice with respect to ASP.NET, and I would appreciate any pointers on how to use VBA (from within EXCEL) to post form data to a .aspx. file on a website, and download an associated data...
2
by: Citoyen du Monde | last post by:
Trying to get some ideas on a simple javascript project (to teach myself the language). I want to develop a client-side vocabulary practice application that would allow users to enter their own...
1
by: Marco Alting | last post by:
Hi, I have an HTML form which enters data in an Access database using ASP. But now my client asked me if it is possible to alert users, when they click a link other then submit on the page, that...
0
by: ernxos | last post by:
Hi, There is a button on one of my www pages which changes page content. It adds some fields to the form, which is created by php script. After changing the page is displayed once again. What I...
2
by: Matuag | last post by:
Hi All, I want to create following command buttons on a Form which users can edit. Save ( Save Changes made) Cancel ( Undo data changes) Exit ( Close form) I am using Macros for each of...
6
by: greg_e | last post by:
Is there a way to create a form in a local html file where the contents of the form are written to a local file when a 'save' button is selected? It would be nice if it was as easy as changing...
1
by: dufnobles via AccessMonster.com | last post by:
How can I manually save information entered on a form onto a table? The form information is derived from different tables. I want to inter the resulting information into another table. Please...
5
by: MeeMee | last post by:
Hi I have a problem with saving form data to a MS Access database. I am using Windows XP, FrontPage 2003, Access 2003, IIS 5.1 and FrontPage Server Extensions. I have followed several tutorials...
2
by: Cron | last post by:
Hi I'm trying to make a form that makes it optional for the user to save the inputted data. If the user does not tap the save button before leaving the form, the data is silently discarded. This...
2
by: kimeee | last post by:
I have a form that faculty need to fill out but it is very long and some stop before they can finish it and then have to re-enter all the fields they previously populated. So my boss asked if there...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.