Solved

Submit Button with Information saved in text file

Posted on 2007-11-14
4
406 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
  • 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

713 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