Solved

HTML Formatting Question

Posted on 2004-10-15
11
140 Views
Last Modified: 2010-04-25
I need to recreate the following in HTML:

Name:  ___________________________________________
              Last                 First                 Middle

I can create the words just fine, it's the line I'm having issues with.  Is there a line drawing functionality of this software other than the horizontal rule?
0
Comment
Question by:johnson00
  • 4
  • 4
  • 2
  • +1
11 Comments
 
LVL 35

Expert Comment

by:mrichmon
ID: 12321359
You can use CSS or you  can use table borders

Is this for an online form (i.e. input boxes will be involved) or for a printed form

With CSS (or a tbale) the bet way to go about it is to have an object (such as a div or table cell) and then add the bottom border with a style like:

border-bottom: solid black 1px;
0
 
LVL 2

Author Comment

by:johnson00
ID: 12321478
Well, I tried that. The issue here is that this HTML page is collecting data from  a form and emailing the data in straight HTML format.  I can get it to print a text box that contains the data, but I really just need to place that data on top of a line.  CSS style works just fine when I preview the file, but when email is generated, the lines are lost. Any other suggestions?
0
 
LVL 35

Expert Comment

by:mrichmon
ID: 12321840
The lines will be lost no matter what in a text based email

In HTML email - it depends on how much HTML the email client supports.

SOme email clients support limited HTML - some support full HTML and CSS - some support nothing.

Can you post the code that you are using to generate the email?
0
 
LVL 2

Author Comment

by:johnson00
ID: 12322061
would you like to see the ASP code that replaces lines of text in the HTML page, or would you like to see the HTML page that's actually being emailed?
0
 
LVL 35

Expert Comment

by:mrichmon
ID: 12322102
maybe both?
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 2

Author Comment

by:johnson00
ID: 12322135
Here's the ASP code:

<%
Dim strDate
Dim strSSN
Dim strLastName
Dim strFirstName
Dim strMiddleName
Dim strPosition
Dim strAdvertisement
Dim strEmpAgency
Dim strFriendRelative
Dim strWeb
Dim strEmployee
Dim strOther
Dim strEmail
Dim strAddress
Dim strCity
Dim strState
Dim strZip
Dim strPhone
Dim strEmployed


strDate       = request.form("Date")
strSSN        = request.form("SSN")
strLastName   = request.form("LastName")
strFirstName  = request.form("FirstName")
strMiddleName = request.form("MiddleName")
strPosition   = request.form("Position")
strEmail      = request.form("Email")
strAddress    = request.form("Address")
strCity       = request.form("City")
strState      = request.form("State")
strZip        = request.form("Zip")
strPhone      = request.form("Phone")
strEmployed   = request.form("SCEmployed")

' set the Check box variables
if not request.form("Advertisement")  = "" then strAdvertisement  = "checked"
if not request.form("EmpAgency")      = "" then strEmpAgency      = "checked"
if not request.form("FriendRelative") = "" then strFriendRelative = "checked"
if not request.form("WEB")            = "" then strWeb            = "checked"
if not request.form("Employee")       = "" then strEmployee       = "checked"
if not request.form("Other")          = "" then strOther          = "checked"


Function generateHTML(filename)
  Dim objFSO
  Dim objTStream
  Dim strText
  Const ForReading = 1

  Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    Set objTStream = objFSO.OpenTextFile(Server.MapPath(filename), ForReading) ' open up the template file for reading
      strText = objTStream.ReadAll ' read all of the file into strText variable
    Set objTStream = Nothing ' Clean up.... we dont need the file open anymore
  Set objFSO = Nothing ' Always clean up after you  ;)

  ' Replace all the placeholders in the template
  strText = Replace(strText, "#### DATE ####", strDate)
  strText = Replace(strText, "#### SSN ####", strSSN)
  strText = Replace(strText, "#### LASTNAME ####", strLastName)
  strText = Replace(strText, "#### FIRSTNAME ####", strFirstName)
  strText = Replace(strText, "#### MIDDLENAME ####", strMiddleName)
  strText = Replace(strText, "#### POSITION ####", strPosition)
  strText = Replace(strText, "#### ADVERTISEMENT ####", strAdvertisement)
  strText = Replace(strText, "#### EMPAGENCY ####", strEmpAgency)
  strText = Replace(strText, "#### FRIENDRELATIVE ####", strFriendRelative)
  strText = Replace(strText, "#### WEB ####", strWeb)
  strText = Replace(strText, "#### EMPLOYEE ####", strEmployee)
  strText = Replace(strText, "#### OTHER ####", strOther)
  strText = Replace(strText, "#### EMAIL ####", strEmail)
  strText = Replace(strText, "#### ADDRESS ####", strAddress)
  strText = Replace(strText, "#### CITY ####", strCity)
  strText = Replace(strText, "#### STATE ####", strState)  
  strText = Replace(strText, "#### ZIP ####", strzip)  
  strText = Replace(strText, "#### PHONE ####", strPhone)
 
  ' How to set the radio boxes   - this is just one of em
  if strEmployed = "TRUE" then
      strText = Replace(strText, "#### SCEMPLOYED_TRUE ####", "checked")
       strText = Replace(strText, "#### SCEMPLOYED_FALSE ####", "")
  else
      strText = Replace(strText, "#### SCEMPLOYED_TRUE ####", "")
       strText = Replace(strText, "#### SCEMPLOYED_FALSE ####", "checked")  
  end if

  '   ############################### THE REST OF THE FIELDS NEED ADDING NOW (GULP) ##################################

  ' Send back the finished HTML string
  generateHTML = strText
End Function

' Now email HR with the app using the template you set up.
Set objEmail = Server.CreateObject("CDONTS.NewMail")
  objEmail.BodyFormat = 0  ' CdoBodyFormatHTML  
  objEmail.MailFormat = 0  ' CdoMailFormatMime
  objEmail.From = strEmail ' who the email is from
  objEmail.To = strEmail   ' Who the email is going to
  objEmail.Subject = "New application"
  objEmail.Body = generateHTML("template.htm")
  objEmail.Send
Set objEmail = Nothing

%>

<html>
<head><title>results</title></head>

<body>
Email sent (we hope)
</body>
</html>

This code replaces identified text in an html form and emails that html form in html format.
0
 
LVL 2

Author Comment

by:johnson00
ID: 12322164
Here's the HTML code.  I've set up a class called borders that just creates a bottom border to the table cell.  I still have some text fields in here too, as I'm trying to get around having to use them.  Unfortunately, without either the text boxes or the lines under the text, what's returned via email is just too hard to read!

<p><strong>Date:</strong> <span class="borders">#### DATE ####</span></p>
<table width="100%"  border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td valign="bottom"><strong>Name:</strong></td>
    <td valign="bottom"><form name="form1" method="post" action="">
      <input name="LastName" type="text" id="LastName" value="#### LASTNAME ####">
    </form></td>
    <td valign="bottom"><form name="form2" method="post" action="">
      <input name="FirstName" type="text" id="FirstName" value="#### FIRSTNAME ####">
    </form></td>
    <td valign="bottom"><form name="form3" method="post" action="">
      <input name="MiddleName" type="text" id="MiddleName" value="#### MIDDLENAME ####">
    </form></td>
    <td valign="bottom"><strong>Social Security #: </strong></td>
    <td valign="bottom" class="borders">#### SSN #### </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td valign="top">Last</td>
    <td valign="top">First</td>
    <td valign="top">Middle</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
<table width="100%"  border="0">
  <tr>
    <td width="22%"><strong>Position(s) Applied for: </strong></td>
    <td width="78%" class="borders">#### POSITION #### </td>
  </tr>
</table>
<table width="100%"  border="0">
  <tr>
    <td><strong>Referral Source: </strong></td>
    <td><FONT FACE="verdana, Helvetica, sans-serif">
      <INPUT TYPE="checkbox" NAME="Advertisement" VALUE="TRUE" #### ADVERTISEMENT ####>
</FONT>      <span class="style2">Advertisement</span></td>
    <td><FONT FACE="verdana, Helvetica, sans-serif">
      <INPUT TYPE="checkbox" NAME="EmpAgency" VALUE="TRUE" #### EMPAGENCY ####>
</FONT>      <span class="style2">Employment Agency</span></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><font face="verdana, Helvetica, sans-serif">
      <input type="checkbox" name="FriendRelative" value="TRUE" #### FRIENDRELATIVE ####>
</font>      <span class="style2">Friend/Relative</span></td>
    <td><input name="WEB" type="checkbox" id="WEB" value="TRUE" #### WEB ####>
Website</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><FONT FACE="verdana, Helvetica, sans-serif">
      <INPUT TYPE="checkbox" NAME="Employee" VALUE="TRUE" #### EMPLOYEE ####>
</FONT>      <span class="style2">Employee</span></td>
    <td><FONT FACE="verdana, Helvetica, sans-serif">
      <INPUT TYPE="checkbox" NAME="Other" VALUE="TRUE" #### OTHER ####>
</FONT>      <span class="style2">Other</span></td>
  </tr>
</table>
<table width="100%"  border="0">
  <tr>
    <td><strong>Address:</strong></td>
    <td class="borders">#### ADDRESS #### </td>
    <td class="borders">#### CITY #### </td>
    <td class="borders">#### STATE #### </td>
    <td class="borders">#### ZIP #### </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>Street</td>
    <td>City</td>
    <td>State</td>
    <td>Zip</td>
  </tr>
</table>
<table width="43%"  border="0">
  <tr>
    <td width="43%"><strong>Telephone Number: </strong></td>
    <td width="57%" valign="bottom" class="borders">#### PHONE #### </td>
  </tr>
</table>
<hr width="100%">
<table width="100%"  border="0">
  <tr>
    <td><strong>Have you ever been employed by Springfield Clinic? </strong></td>
    <td><FONT FACE="verdana, Helvetica, sans-serif">
      <INPUT TYPE="radio" NAME="SCEmployed" VALUE="TRUE" #### SCEMPLOYED_TRUE #### >
Yes </FONT></td>
    <td><FONT FACE="verdana, Helvetica, sans-serif">
      <INPUT TYPE="radio" NAME="SCEmployed" VALUE="FALSE" #### SCEMPLOYED_FALSE ####>
No</FONT></td>
    <td>If Yes, </td>
  </tr>
</table>
<p>&nbsp;</p>
<p>&nbsp; </p>
</body>
</html>
0
 
LVL 35

Expert Comment

by:mrichmon
ID: 12323393
I don't see the class definitions in the generated HTML code.

You will need to either include a stylesheet or embed the styles (probably the better option) into the email messge HTML so that email clients that do understand how to render the HTML with CSS can find the class definitions to do so.
0
 
LVL 12

Accepted Solution

by:
minichicken earned 250 total points
ID: 12326858
To create:
Name:  ___________________________________________
              Last                First                Middle

in HTML:

**************************************************************************

<table width="50%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>Name:</td>
    <td colspan="3" style="border-bottom-width:1px; border-bottom-color:#333333; border-bottom-style:solid">&nbsp;</td>
  </tr>
  <tr>
    <td width="7%">&nbsp;</td>
    <td width="31%" align="center">Last</td>
    <td width="31%" align="center">First</td>
    <td width="31%" align="center">Middle</td>
  </tr>
</table>
0
 
LVL 1

Expert Comment

by:chief77
ID: 12336700
Why not just use <u> for underline? quick and easy, and it is what he is looking for. a line under the text :-)

hehe

Kel
0
 
LVL 12

Expert Comment

by:minichicken
ID: 12336714
If you use <u> it will only underline when there are characters, if there are no characters, then there will be no underline....
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

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

762 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

17 Experts available now in Live!

Get 1:1 Help Now