473,395 Members | 1,348 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,395 software developers and data experts.

HTML FORM and Saving to Local HD

4
Hi there:

I have made a simple HTML form. I ONLY want this form for off-line purpose on my computer, not on the internet.. I don't want the form to go to email or on the web. If I fill-out the form on my computer ... can I save the data entered into the form on my hard drive? may be save it as text or whatever readable file so I can retrieve it later on? If such thing exists please send or direct me where I can download such script? Thank u so much.
Feb 28 '07 #1
7 1949
acoder
16,027 Expert Mod 8TB
Hi there:

I have made a simple HTML form. I ONLY want this form for off-line purpose on my computer, not on the internet.. I don't want the form to go to email or on the web. If I fill-out the form on my computer ... can I save the data entered into the form on my hard drive? may be save it as text or whatever readable file so I can retrieve it later on? If such thing exists please send or direct me where I can download such script? Thank u so much.
Welcome to TSDN (The Scripts).

You will need some server-side code to do this, or if you're using IE and possibly change your settings, you could use an ActiveX object in JScript, e.g.
Expand|Select|Wrap|Line Numbers
  1. // Instantiate a File System ActiveX Object:
  2. var fso = new ActiveXObject("Scripting.FileSystemObject");
  3. var txtFile = fso.CreateTextFile("c:\\testfile.txt", true);
  4. txtFile.WriteLine("This is a test.");
  5. txtFile.Close();
where instead of "This is a test." on line 4, you'd write in the form values on form submit.
If you wanted to load the values, you read from the file.

One other option is to save the values in cookies, see this page. That's a better solution because it's cross-browser.
Feb 28 '07 #2
kks
4
Thank you for your reply. Sorry I have no programming background. I am a bit confused. The script you gave me... do I place it in the header of HTML? and where do I change my setting in the IE? Basically, I need a little script maybe in php/javascript/etc.. to save my form on my HD. I thought it would be easier to do this...but it seems I got go through some programming I guess. If you can help I would greatly appreciate it. Thanks. Kelly
Feb 28 '07 #3
acoder
16,027 Expert Mod 8TB
Read through the cookies link that I gave you. If there's anything you don't understand, post again. You could read through the basics of javascript too if you have no experience (see the Offsite Links at the top of this forum).

Once you have a basic grasp of these concepts, we can move onto storing and retrieving your form values.
Mar 1 '07 #4
kks
4
I have read the cookie section several times and I got the hang of it a little. I am just wondering where would I place the cookie...in the "header" of HTML page ? By the way, I am using Dreamweaver MX if that helps me to do this quickly. Thanks
Mar 2 '07 #5
acoder
16,027 Expert Mod 8TB
You don't place the cookie anywhere. It gets placed for you probably in your temp folder. When retrieving, the document.cookie will have the cookie values. you just to parse them to retrieve your stored values.
Mar 2 '07 #6
kks
4
Ok thankx that made some things clear for me.

Now, I got my form ready and I am just wondering what's the next to be done. How do I go through to complete the task of saving the form on my HD using a cookie? Any detailed explanation would be great.. or if you have an example of a pre-existing form with a function of saving it local HD would be even perfect.
Mar 2 '07 #7
acoder
16,027 Expert Mod 8TB
In the link I gave you, take the three functions for creating, reading and erasing cookies. Put them in a javascript file, cookies.js and include them in your page.

Do you know how to access form elements? Show your form code so I can give you examples.
Mar 3 '07 #8

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

Similar topics

5
by: grz02 | last post by:
A question on html-forms: We have an application where users will get a CD with, among other things, some html-forms for them to fill in. When they click the submit-button, the data is...
6
by: Vijay | last post by:
I need to generate HTML files based on the some codes. One HTML file per code. I have the link (ex:http://123.234.345.456/WebPages/GetTestData.aspx?SomeCode=25), by passing the code as parameter I...
6
by: Chris Cox | last post by:
I'm trying to put together a simple access database that will allow a friend to maintain a simple database of products/pictures/prices, which he can then export to html and upload to a website. ...
3
by: Clay Black | last post by:
I need to find a way to save an HTML page to the IIS server. What I need is to have a button that once it is clicked the current page being displayed is saved to a location on the local IIS...
82
by: Eric Lindsay | last post by:
I have been trying to get a better understanding of simple HTML, but I am finding conflicting information is very common. Not only that, even in what seemed elementary and without any possibility...
6
by: catherine.bajis | last post by:
I have a small project to create some simple HTML forms. Rather than have our users go to our web page and 'SUBMIT' the form data, it would be easier for them to fill out a simple standalone form,...
1
by: Max Power | last post by:
HTML reprocessor: how do you get rid of the obese MS-Word (normal or filtered) HTML? I just want all the fancy MS tags removed and replaced with basic ones, or if applicable -- stripped entirely...
3
by: Sunny | last post by:
Hi, Can someone tell me, How to load the Body Html from a text file that contains javascript. to Manage my files I am creating an Index Page. <html> <head> <meta http-equiv="content-type"...
0
by: studentofknowledge | last post by:
hi my knowledgeable comrads I have created a web form using html, css with the addition of some basic javascript validation. Although now im having trouble to insert this information to my local...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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.