Solved

Form Submit to Text file

Posted on 2003-11-08
3
268 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Build and evolve an interactive experience 1 89
CSS HELP 6 84
How to get statistic's from a competitors website?! 1 87
Questions about this React unit test 4 46
Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

867 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now