Solved

Submit Button with Information saved in text file

Posted on 2007-11-14
4
400 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Editing XSL files, 2 21
Hovering effect 9 29
Glyph icons in Bootstrap 3 4 16
Retrieve values of an HTML form using JQUERY 2 17
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

760 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