Solved

Form Submit to Text file

Posted on 2003-11-08
3
271 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 34 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 33 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 33 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
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 if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
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…

730 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