Asp Error in sending a form

Posted on 2004-11-11
Medium Priority
Last Modified: 2008-02-26
I am getting this error when I am trying to submit a form.

Microsoft VBScript compilation error '800a03f2'

Expected identifier

/contact1.asp, line 21

Dim Type

Below is the code to my asp page and to my html page. Can you please help fix this error so that the form will work...thanks


' declare variables
Dim EmailFrom
Dim EmailTo
Dim Subject
Dim Name
Dim Company
Dim Address
Dim City
Dim State
Dim Zip
Dim Phone
Dim Fax
Dim Email
Dim Hear
Dim Type
Dim JobType
Dim other
Dim footage
Dim Comments

' get posted data into variables
EmailFrom = "sales@decopavers.com"
EmailTo = "sales@decopavers.com"
Subject = "Results From the online Form"
Name = Trim(Request.Form("Name"))
Company = Trim(Request.Form("Company"))
Address = Trim(Request.Form("Address"))
City = Trim(Request.Form("City"))
State = Trim(Request.Form("State"))
Zip = Trim(Request.Form("Zip"))
Phone = Trim(Request.Form("Phone"))
Fax = Trim(Request.Form("Fax"))
Email = Trim(Request.Form("Email"))
Hear = Trim(Request.Form("Hear"))
Type = Trim(Request.Form("Type"))
JobType = Trim(Request.Form("JobType"))
other = Trim(Request.Form("other"))
footage = Trim(Request.Form("footage"))
Comments = Trim(Request.Form("Comments"))

' validation
Dim validationOK
If (validationOK=false) Then Response.Redirect("error.htm?" & EmailFrom)

' prepare email body text
Dim Body
Body = Body & "Name: " & Name & VbCrLf
Body = Body & "Company: " & Company & VbCrLf
Body = Body & "Address: " & Address & VbCrLf
Body = Body & "City: " & City & VbCrLf
Body = Body & "State: " & State & VbCrLf
Body = Body & "Zip: " & Zip & VbCrLf
Body = Body & "Phone: " & Phone & VbCrLf
Body = Body & "Fax: " & Fax & VbCrLf
Body = Body & "Email: " & Email & VbCrLf
Body = Body & "Hear: " & Hear & VbCrLf
Body = Body & "Type: " & Type & VbCrLf
Body = Body & "JobType: " & JobType & VbCrLf
Body = Body & "other: " & other & VbCrLf
Body = Body & "footage: " & footage & VbCrLf
Body = Body & "Comments: " & Comments & VbCrLf

' send email
Dim obCDO
     Set obCDO = Server.CreateObject("CDO.message")
        with obCDO
         .From = "sales@decopavers.com"
         .To = "sales@decopavers.com"
         .Subject = "Request results"
         .TextBody = "This is a results from your online Form" & Body & vbCrLf
        end with

' redirect to success page
Response.Redirect("ok.htm?" & EmailFrom)


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
body {
      margin-left: 0px;
      margin-top: 0px;
      margin-right: 0px;
      margin-bottom: 0px;
.style6 {font-size: 10px}
.style4 {font-size: 9px}

<table width="428" border="0" cellspacing="0" cellpadding="0">
    <td width="478" height="410" valign="bottom" background="images/pattern_bg.gif"><div class="ver9" style="padding-top:0; padding-left:0; padding-right:0; color:#4f4836; font-size: 12px; font-family: Tahoma;">
      <div align="center"><form method="POST" action="contact1.asp">
  <table width="375" border="0" cellspacing="5" cellpadding="0">
      <td colspan="4"><div align="center"><span class="style12 style3"><span class="style4"><b><font face="Arial, Helvetica, sans-serif"><br>
      <td><div align="left" class="style6">Name:</div></td>
            <div align="left" class="style6">
              <input name="Name" type="text" size="15">
      <td><div align="left"><span class="style6">Phone</span></div></td>
      <td><div align="left"><span class="style6">
          <input name="Phone" type="text" size="15">
      <td width="86"><div align="left" class="style6">Company Name:</div></td>
              <div align="left" class="style6">
                <input name="Company" type="text" size="15">
      <td><div align="left"><span class="style6">Fax</span></div></td>
      <td><div align="left"><span class="style6">
          <input name="Fax" type="text" size="15">
      <td><div align="left" class="style6">Address</div></td>
      <td width="117">
              <div align="left" class="style6">
                <input name="Address" type="text" size="15">
      <td width="46"><div align="left" class="style6">
        <div align="left" class="style6">
          <div align="left">City</div>
      <td width="101">
                <div align="left" class="style6">
                  <div align="left">
                    <input name="City" type="text" size="15">
      <td><div align="left" class="style6">State</div></td>
              <div align="left" class="style6"><font face="Arial, Helvetica, sans-serif">
                <select name="State" id="select15">
                  <option  value="">Please select</option>
                  <option  value="AK">AK</option>
                  <option  value="AL">AL</option>
                  <option  value="AR">AR</option>
                  <option  value="AZ">AZ</option>
                  <option  value="CA">CA</option>
                  <option  value="CO">CO</option>
                  <option  value="CT">CT</option>
                  <option  value="DC">DC</option>
                  <option  value="DE">DE</option>
                  <option  value="FL">FL</option>
                  <option  value="GA">GA</option>
                  <option  value="HI">HI</option>
                  <option  value="IA">IA</option>
                  <option  value="ID">ID</option>
                  <option  value="IL">IL</option>
                  <option  value="IN">IN</option>
                  <option  value="KS">KS</option>
                  <option  value="KY">KY</option>
                  <option  value="LA">LA</option>
                  <option  value="MA">MA</option>
                  <option  value="MD">MD</option>
                  <option  value="ME">ME</option>
                  <option  value="MI">MI</option>
                  <option  value="MN">MN</option>
                  <option  value="MO">MO</option>
                  <option  value="MS">MS</option>
                  <option  value="MT">MT</option>
                  <option  value="NC">NC</option>
                  <option  value="ND">ND</option>
                  <option  value="NE">NE</option>
                  <option  value="NH">NH</option>
                  <option  value="NJ">NJ</option>
                  <option  value="NM">NM</option>
                  <option  value="NV">NV</option>
                  <option  value="NY">NY</option>
                  <option  value="OH">OH</option>
                  <option  value="OK">OK</option>
                  <option  value="OR">OR</option>
                  <option  value="PA">PA</option>
                  <option  value="RI">RI</option>
                  <option  value="SC">SC</option>
                  <option  value="SD">SD</option>
                  <option  value="TN">TN</option>
                  <option  value="TX">TX</option>
                  <option  value="UT">UT</option>
                  <option  value="VA">VA</option>
                  <option  value="VT">VT</option>
                  <option  value="WA">WA</option>
                  <option  value="WI">WI</option>
                  <option  value="WV">WV</option>
                  <option  value="WY">WY</option>
              </font>              </div></td>
      <td><div align="left" class="style6">Zip</div></td>
                <div align="left" class="style6"><font face="Arial, Helvetica, sans-serif"><font face="Arial, Helvetica, sans-serif">
                  <input name="Zip" type="text" size="15">
                </font>                </div></td>
      <td class="style6">Email</td>
      <td><div align="left" class="style6"><font face="Arial, Helvetica, sans-serif">
        <input name="Email" type="text" size="15">
                <div align="left" class="style6">                    </div></td>
      <td><div align="left" class="style6"></div></td>
              <div align="left" class="style6">                    </div></td>
      <td><div align="left"><span class="style6"><span class="style6"></span></span></div></td>
      <td><div align="left"><font face="Arial, Helvetica, sans-serif"><span class="style6"><span class="style6"></span></span></font>

  <table width="375" border="0" cellpadding="0" cellspacing="5">
      <td width="76"><div align="left" class="style6">How did you hear bout us:</div></td>
      <td width="284"><div align="left" class="style6"><font face="Arial, Helvetica, sans-serif">
          <select name="Hear" id="select10">
            <option  value="">Please select</option>
            <option value="TRADE SHOW">TRADE SHOW</option>
            <option value="MAGAZINE">MAGAZINE</option>
            <option value="YELLOW PAGES">YELLOW PAGES</option>
            <option value="DIRECT MAIL">DIRECT MAIL</option>
            <option value="SEARCH ENGINE">SEARCH ENGINE</option>
            <option value="REFERRAL">REFERRAL</option>
            <option value="OTHER...">OTHER...</option>
      </font></div>        <div align="left"><span class="style6"></span></div>      <div align="left"><font face="Arial, Helvetica, sans-serif"><span class="style6"></span></font> </div></td>
      <td><div align="left" class="style6">Type of Job </div></td>
      <td><div align="left" class="style6"><font face="Arial, Helvetica, sans-serif">
          <select name="JobType" id="select11">
            <option  value="">Please select</option>
            <option value="DRIVE WAY">DRIVE WAY</option>
            <option value="POOL PATIO">POOL PATIO</option>
            <option value="STREET">STREET</option>
            <option value="ROAD ENTRANCE">ROAD ENTRANCE</option>
            <option value="SIDEWALK">SIDEWALK</option>
            <option value="OTHER">OTHER</option>
      </font></div>        <div align="left"><span class="style6"></span></div>      <div align="left"><font face="Arial, Helvetica, sans-serif"><span class="style6"></span></font> </div></td>
      <td><div align="left" class="style6">Project Type:</div></td>
      <td><div align="left" class="style6"><font face="Arial, Helvetica, sans-serif">
          <select name="Type" id="select12">
            <option  value="">Please select</option>
            <option value="Residential ">Residential </option>
            <option value="Commercial">Commercial</option>
      </font></div>        <div align="left"><span class="style6"></span></div>
        <div align="left"><font face="Arial, Helvetica, sans-serif"><span class="style6"></span></font> </div></td>
      <td><div align="left" class="style6">If Other</div></td>
        <div align="left" class="style6">
          <input name="other" type="text" size="15">
      </div>        <div align="left"><span class="style6"></span></div></td>
      <td><div align="left" class="style6">Square footage</div></td>
      <td><div align="left" class="style6"><font face="Arial, Helvetica, sans-serif">
          <select name="footage" id="select13">
            <option  value="">Please select</option>
            <option value="UNDER 1,000">UNDER 1,000</option>
            <option value="1,000 TO 5,000">1,000 TO 5,000</option>
            <option value="5,000 TO 10,000">5,000 TO 10,000</option>
            <option value="10,000 &amp; OVER">10,000 &amp; OVER</option>
      </font></div>        <div align="left"><span class="style6"></span></div>      <div align="left"><span class="style6"></span></div></td>
      <td><div align="left" class="style6">Additional Comments:</div></td>
      <td><div align="left" class="style6"><font face="Arial, Helvetica, sans-serif">
          <textarea name="Comments" cols="33" rows="2" id="textarea3"></textarea>
      <td colspan="2">
        <div align="right">
          <input type="submit" name="submit" value="Submit">
  </form>      </div>

Question by:drujames
  • 2

Accepted Solution

JpmSoft earned 2000 total points
ID: 12559192
Type is a restricted Keyword on most languages, you shold try

Dim Type1  ' instead of Type

Good Luck

Expert Comment

ID: 12559219
Sorry that was a "should"

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Six Sigma Control Plans

809 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