Articles   Dev Forums   Personalize   Favorites   Member Login        Active Users:  49
DevASP - ASP and XML Articles, Samples, Toturials, Sample Chapters and resources for Developers Friday, November 21, 2008
Home
Articles & Samples
Dev Search
Dev Forum
Add a Listing
Sample Chapters
Directory Feed
Link to US
Contact

Search Directory
Applications
Articles & Samples
Components
Community
Database
Developer Sites
Downloads
Hosting Services
Introduction
Knowledge Base
Sample Chapters
WebCasts

Trusted by over 7 million customers!
ASP Directory
Applications
Articles & Samples
Components
Developer Sites
Knowledge Base
Sample Chapters
WebCasts
XML Directory
Applications
Articles & Samples
Developer Sites
Error, Bugs & Fixes
Downloads
Introduction
Knowledge Base
Sample Chapters
WebCasts

Text box and Textarea

This sample is using two files. One is simple HTML page to enter data, and second is an ASP Page which get the data entered in the form.



  <form method="Post" action="textboxasp.asp">
    <table width="400">
      <tr>
        <td>
          <b>1. Your First Name:<br>
          </b>
          <menu>
            <input size="35" name="FirstName" type="text">
          </menu>
          <b>2. Your Last Name:<br>
          </b>
          <menu>
            <input size="35" name="LastName" type="text">
          </menu>
          <b>3. Comments<br>
          </b></font>
          <menu>
            <textarea rows="5" cols="35" name="Comments">
      This is how it works
      </textarea>
          </menu>
          <p>
            <center>
              <input type="submit" value="Submit">
              <input type="reset" value="Reset">
            </center>
        </td>
      </tr>
    </table>
  </form>


<%
' Dimension loacl variables
Dim strFirstName, strLastName, strComments
' Get the values entered in the form 
' and send to server using Post method
strFirstName = Request.Form("FirstName")
strLastName = Request.Form("LastName")
strComments = Request.Form("Comments")
' This is simple text box so there is nothing much to do
' you can either store these calues to database 
' or a text file or send back to client what ever you 
' have the process for data 
' In this example i just simply display then to client
%>
<p>
  <b>Name:</b>
  <%=strLastName%>
  &nbsp;<%=strFirstName%>
<p>
  <b>Comments: </b>&nbsp;<%=strComments%><br>


Test this sample here


Have Questions? Discuss this topic in Dev Forum

Back to ASP Samples
DevASP - Privacy - Disclaimer
Copyright © 2008 DevASP.com