Solved

saving data on form submit

Posted on 2004-10-14
8
221 Views
Last Modified: 2010-04-09
Hi,

Can i write the data input in the html form fields to a text file...  like take the example of a quiz, the user takes a multiple choice answers quiz and i want to save the answers he chooose to a text file..  is it possible in simple html  or do i need to use asp or some scripting language..

plz reply now..


regards,.

0
Comment
Question by:ganatra
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
8 Comments
 
LVL 52

Expert Comment

by:Ryan Chong
ID: 12315454
Is the file generated saves to local or at server?

You definitely need to use server side scripting language (like asp you mentioned) if you want to save the content at server.
0
 

Author Comment

by:ganatra
ID: 12315544
i was wonder if i dont use a server.. and do it locally.. is there any java script that let me do this..  if not can u provide me with some good link of the asp code that writes form data to a file..

i'll be grateful..

regards,...
0
 
LVL 52

Expert Comment

by:Ryan Chong
ID: 12315808
You probably need use Java Applet instead, as javascript is not capable to save file locally.

I will provide you the asp code to save content as file shortly.

cheers
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:ganatra
ID: 12319845
ryancys.. i am waiting for the code you said you will provide..
0
 
LVL 52

Accepted Solution

by:
Ryan Chong earned 25 total points
ID: 12326789
Sorry for the late response, ganatra.

To save the form content to a file, you can try like:

<%...
Dim fso, MyFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.OpenTextFile(Server.MapPath(".") & "testfile.txt", 8, True)

For Each i in Request.Form
  MyFile.WriteLine i & ": " & Request.Form(i)
Next
MyFile.Close
%>

then try to access the testfile.txt.

Original code by Yury_Delendik can be found at: http:Q_10307945.html

Another useful example at:
http://www.w3schools.com/asp/met_opentextfile.asp

More info regarding FSO in ASP can be found at:
http://www.w3schools.com/asp/asp_ref_filesystem.asp

Hope this helps
0
 
LVL 4

Expert Comment

by:sprisoner
ID: 12806843
ryancys is write...good coding of course. What it does is reads the requested form line by line and writes to a text created by FSO. So, an important issue is to make sure that u have nothing extra in the requested form than the required data...because whatever it be, will get written to the text file. Be careful with this.
Nash
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Need to add another Column in Powershell script output 2 46
What cart is this? 2 55
Html split(text) Part2 6 41
Making Table Thru ASP Response.write 5 37
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question