?
Solved

Form Submit to Text file

Posted on 2003-11-08
3
Medium Priority
?
273 Views
Last Modified: 2010-04-06
Hello, I have a web page that has several drop down boxes. I would like to have a form that submits the selections in these dropdowns to a text file or html file.  

I do not have a real web server available for this (small office info page) so cant use ASP.

I would like each new entry to be appended to the file rather than have a new file created. Can someone lead me in the right direction here? Im not much of a web programmer and am not sure where to start (or if this is possible)

Thanks
0
Comment
Question by:Zakoriz
[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 Comments
 
LVL 11

Accepted Solution

by:
Zontar earned 102 total points
ID: 9708842
If you're using any favour of Windows (except maybe for ME or XP), you can install either IIS (NT/2000)  or PWS (9X) and so have Active Server Pages.

Apache is also available for Windows and runs on any version of it. You can't run ASP on Apache, but you can run PHP no problem.

In either case you don't need a special machine just to run a Web server. You can do that on your desktop machine.

But you can't use Web page forms to add info to a DB or a file without a web server of some sort, so you'll need to get that issue resolved first.

A little more info about your circumstances would be helpful.
0
 
LVL 6

Assisted Solution

by:aolXFT
aolXFT earned 99 total points
ID: 9710265
Hmmm,

This will require a bit of engineering.

From your post, I'm assuming that the text file is actually on your own machine. Therefore it might be concevable to use client-side technology to do the job for you.

I'd consider looking into ActiveX, if you are using Internet Explorer, or java, if you have that enabled.

Check out http://forums.devshed.com/t605/s.html and http://www.nigelrivett.net/DTSActivexFileExists.html

or make a post in the Java/ActiveX sections of this site.
0
 
LVL 15

Assisted Solution

by:VincentPuglia
VincentPuglia earned 99 total points
ID: 9723249
Hi,

presuming you have a Windows environment:

<html><head>
<script language='javascript' type='text/javascript'>
<!--
function sendit(formObj)
{
  var fso, ts, s, stuff;
  var ForAppending=8;
  var txtFile = formObj.d.value;

  var stuff = new Array();
  stuff[0] = formObj.b.name;
  stuff[1] = formObj.b.options[formObj.b.selectedIndex].value;
  stuff[2] = formObj.c.name;
  stuff[3] = formObj.c.options[formObj.c.selectedIndex].value;

  fso = new ActiveXObject("Scripting.FileSystemObject")
  ts = fso.OpenTextFile(txtFile, ForAppending)

  for (var i = 0; i < stuff.length; i++)
      ts.WriteLine('Element ' + stuff[i++] + ' = ' + stuff[i]);
  ts.Close()
}
//-->
</script>
</head>
<body>
<form name="a">
<select name='b'>
<option>select</option>
<option value="1">1</option>
<option value="2">2</option>
</select>
<select name='c'>
<option>select</option>
<option value="a">1</option>
<option value="b">2</option>
</select>
<input type="file" name="d">
<input type='button' onclick='sendit(this.form)'>
</form>
</body>
</html>

Vinny
0

Featured Post

Technology Partners: 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!

Question has a verified solution.

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

Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses

764 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