Solved

Submit Button with Information saved in text file

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

930 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

12 Experts available now in Live!

Get 1:1 Help Now