Solved

Submit Button with Information saved in text file

Posted on 2007-11-14
4
407 Views
Last Modified: 2008-02-01
Hi Experts,
I have the following html  which is a form that allows the user to fill in some fields and attach files.
Is it possible to collect all the information and put them into a text file and send the text file together with any attached files to an email address?

Thanks
noobe1

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
      <head>
            <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
            <title>Untitled Document</title>
            <style type="text/css" media="screen">
                  <!--
                        @import url("common/css/tags.css");
                  -->
            </style>
      </head>
      
      <body class="subpage">
            <div class="wrap">
                  <div class="linksTopRight">
                        <ul class="navListDefaults">
                              <li><a bref="">Home</a></li>
                              <li>|</li>
                              <li><a bref="">News</a></li>
                              <li>|</li>
                              <li><a bref="">Careers</a></li>
                              <li>|</li>
                              <li><a bref="">Contact Us</a></li>
                        </ul>
                  </div><!-- end : linksTopRight -->
                  
                  <div class="clear"></div>
                  <div class="clearfix">
                  <h1><a bref="home.htm">XYZ Solutions</a></h1>
                  
                  <div class="linksTopLeft clearfix">
                        <ul class="navListDefaults">
                              <li class="active"><a bref="" class="linkAboutUs">about us</a></li>
                              <li><a bref="" class="linkExpertise">expertise</a></li>
                              <li><a bref="" class="linkClients">clients</a></li>
                              <li><a bref="" class="linkOurTeam">our team</a></li>
                              <li><a bref="" class="linkCareers">careers</a></li>
                              <li><a bref="" class="linkContactUs">contact us</a></li>
                        </ul>
                  </div><!-- end : linksTopLeft -->
                  </div>
                  <div class="clear"></div>
                  
                  <h2 class="pageName">About Us > Recuitment</h2>
                  
                  <div class="content">
                        <form action="" method="post" name="recuitment" id="recuitment" class="recuitment">
                              <fieldset>
                                    <legend>Personal Information</legend>
                                    <fieldset>
                                          <label for="fullName"><span class="required">*</span>Full Name:</label>
                                          <input type="text" name="fullName" id="fullName" class="rec"/>
                                    </fieldset>
                                    <fieldset>
                                          <label for="phoneNumber"><span class="required">*</span>Phone Number:</label>
                                          <input type="text" name="phoneNumber" id="phoneNumber" class="rec"/>
                                    </fieldset>
                                    <fieldset>
                                          <label for="emailAddress"><span class="required">*</span>Email Address:</label>
                                          <input type="text" name="emailAddress" id="emailAddress" class="rec"/>
                                    </fieldset>
                                    <fieldset>
                                          <label for="resume">Resume:</label>
                                          <input type="file" name="resume" id="resume" class="rec"/>
                                    </fieldset>
                                    <fieldset>
                                          <label for="cover">Cover Letter:</label>
                                          <input type="file" name="cover" id="cover" class="rec"/>
                                    </fieldset>
                                    <fieldset>
                                          <label for="cover">How did you hear about us?</label>
                                          <select name="hear" id="hear">
                                                <option selected="selected"></option>
                                                <option value="Friend">Friend</option>
                                                <option value="Website">Website</option>
                                                <option value="Clearancejobs.com">Clearancejobs.com</option>
                                                <option value="Other">Other</option>
                                          </select>
                                          <input type="text" name="other" class="rec"/>
                                    </fieldset>
                              </fieldset>
                              <fieldset>
                                    <legend>Optional fields:</legend>            
                                    <fieldset>      
                                          <label for="address">Street Address:</label>
                                          <input type="text" name="address" id="address" class="rec"/>
                                    </fieldset>
                                    <fieldset>
                                          <label for="city">City:</label>
                                          <input type="text" name="city" id="city" class="rec"/>
                                    </fieldset>
                                    <fieldset>
                                          <label for="state">State:</label>
                                          <input type="text" name="state" id="state" class="rec"/>
                                    </fieldset>
                                    <fieldset>
                                          <label for="zipCode">Zip Code:</label>
                                          <input type="text" name="zipCode" id="zipCode" class="rec"/>
                                    </fieldset>
                              </fieldset>
                              <input type="submit" class="submit" name="submit" value="Submit"/>
                        </form>
                  </div><!-- end : content -->
                  
            </div><!-- end : wrap -->
      </body>
</html>
0
Comment
Question by:noobe1
[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
  • 2
4 Comments
 
LVL 3

Expert Comment

by:samalraj
ID: 20281033
Hi,
JavaScript is not allowed to write anything to the hard drive. There are no read/write methods for the local hard drive, try to collect at server and store it in file there if you want to do so

Regards,
Amal
0
 
LVL 11

Expert Comment

by:cmhunty
ID: 20281225
You've posted in ASP.NET zone. Are you using ASP.NET? If you are, change the inputs for asp:textboxes and so on. From there, you can create a text file and a mailmessage object and send that.
0
 

Author Comment

by:noobe1
ID: 20281339
Hi cmhunty,
If I change the inputs to asp:textboxes, how do I create the text file?

Thanks
0
 
LVL 11

Accepted Solution

by:
cmhunty earned 500 total points
ID: 20281619
Use streamwriter. All you'll have to do is create it and then write to it

Dim sw As New StreamWriter("C:\test.txt")
sw.WriteLine(tb.Text)
sw.Close
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Suggested Solutions

Title # Comments Views Activity
Blending HTML output from R Studio into a ASP.Net/C# project 4 50
aria difference 2 22
Error Handler 8 42
Why am I losing my session variable value 11 39
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.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

734 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