• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 412
  • Last Modified:

Submit Button with Information saved in text file

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
noobe1
Asked:
noobe1
  • 2
1 Solution
 
samalrajCommented:
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
 
cmhuntyCommented:
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
 
noobe1Author Commented:
Hi cmhunty,
If I change the inputs to asp:textboxes, how do I create the text file?

Thanks
0
 
cmhuntyCommented:
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now