Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Form Submit to Text file

Posted on 2003-11-08
3
Medium Priority
?
274 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

597 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