Results 1 to 6 of 6

Thread: Email Address fill-in on ASP form; ExportMagic=True

  1. #1
    Join Date
    Feb 2003
    Posts
    10

    Email Address fill-in on ASP form; ExportMagic=True

    Upon opening a page that uses a separate template, I want the Email address to fill-in the value automatically in the Input box at the bottom of the page. This allows the user to open the page, see that the email address is already there and click SEND to send the form. Here is what I'm using to get the email address:

    <FORM>
    <%
    EMADDR = session("aspdb_600_AgtAssignEmail")
    Response.write(" ") & EMADDR
    %>
    <BR>
    <B>Email Addr:</B> <INPUT TYPE=TEXT SIZE=30 NAME=emailaddress VALUE= <% Response.write(" ") & EMADDR %> >
    <B>Optional Note:</B><INPUT TYPE=TEXT SIZE=25 NAME='EXTRA'>
    <B>Email Subject:</B><INPUT TYPE=TEXT SIZE=25 NAME=ESUB VALUE= "Letter from Relocation" >
    <INPUT TYPE="Submit" NAME="EMAILMe" VALUE="Send">
    </FORM>

    If I have:
    Mydb.dbOptions = "ExportMagic=True" then the VALUE= statement for the emailaddress won't work. I comment out the dbOptions statement, then it will work, but I don't get any formatting for the percent and date fiedls.

    How can I have both the formatting for the percent and date fields in the template, and have the email address fill-in?

  2. #2
    Join Date
    Oct 2002
    Posts
    933
    I think you better post the complete test code to use the template.

    FK

  3. #3
    Join Date
    Feb 2003
    Posts
    10
    Here's the complete code:

    <HTML>

    <title>Assigned Conf Ltr In</title>


    <BODY >

    <%
    SESSION("EXTRA_600") = ""

    response.write("<B><center> " & FormatDateTime(date(),1) & "</B><BR>")

    Set MyDb = Server.CreateObject("ASP.db")
    MyDb.dbUnit = 600
    'MyDb.dbDBType = "ACCESS"
    MyDb.dbDBType = "SQL"
    'Mydb.dbMDB = Server.MapPath(session("aspdb_1000_CompanyDB"))
    Mydb.dbDAT = "PROSWS," & Session("SQLDATABASE") & Session("SQLUIDPWD")
    MyDb.dbSQL = "Select * from Referrals WHERE ReferralsID = " & session ("aspdb_100_ReferralsID")

    ' Mydb.dbOptions = "ExportMagic=True"

    MyDb.dbExportFlds = "City,State,Zip,ReferralType,ReferralStatus,FileNu m,DateRecvd,Date, " &_
    "ClientFName,ClientLName,ClientAddr,ClientCity,Cli entState,ClientZip,HomePhone, " &_
    "ClientCell,ClientEmail,WorkPhone, " &_
    "AgentAssigned,AgentOffice,Address1,OfficeLocation , " &_
    "NetReferFeePercent, ReloDeptPercent,BodyText,DefaultName,Address," &_
    "ContactFName,ContactLName,AgtAssignFirstName,AgtA ssignLastName,RefAgtFirstName,RefAgtLastName," &_
    "ContactEmail,ReferAgtEmail,AgtAssignEmail"

    Mydb.dbMagicCell = "(|,)ContractDate,align=center, <FONT FACE='Arial' SIZE=2 COLOR=black>format=[dd-mmm-yyyy]&nbsp;, | " &_
    "DateRecvd,align=center, <FONT FACE='Arial' SIZE=2 COLOR=black> format=[dd-mmm-yyyy]&nbsp;</FONT>, | " &_
    "ReferralType,align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>#ReferralType#</FONT>,| " &_
    "ReferralStatus,align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>#ReferralStatus#</FONT>,| " &_
    "FileNum,align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>#FileNum#</FONT>,| " &_
    "ContactName,align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>#ContactName#</FONT>,| " &_
    "ContactFName,align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>#ContactFName#</FONT>|" &_
    "ContactLName,align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>#ContactLName#</FONT>|" &_
    "ContactPhone,align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>format=[(###)###-####]&nbsp;</FONT>|" &_
    "ContactExt,align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>#ContactExt#</FONT>|" &_
    "Firm,align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>#Firm#</FONT>|" &_
    "ContactFax,align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>format=[(###)###-####]&nbsp;</FONT>|" &_
    "ContactAddr,align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>#ContactAddr#</FONT>|" &_
    "ContactCity,align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>#ContactCity#</FONT>|" &_
    "ContactState,align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>#ContactState#</FONT>|" &_
    "ContactZip,align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>#ContactZip#</FONT>|" &_
    "CategoryAffinity,align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>#CategoryAffinity#</FONT>|" &_
    "ContactEmail,align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>#ContactEmail#</FONT>|" &_

    "SalePrice, align=right,<FONT FACE='Arial' SIZE=2 COLOR=black>format=[currency]| " &_
    "NetReferFeePercent, align=right,<FONT FACE='Arial' SIZE=2 COLOR=black>format=[percent]| " &_

    "AgentOffice, align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>#AgentOffice#</FONT>| " &_
    "AgtAssignFirstName,align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>#AgtAssignFirstName#</FONT>|" &_
    "AgtAssignLastName,align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>#AgtAssignLastName#</FONT>|" &_
    "AgentPhone,align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>format=[(###)###-####]&nbsp;</FONT>|" &_
    "AgentExt,align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>#AgentExt#</FONT>|" &_
    "AgtAssignEmail,align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>#AgtAssignEmail#</FONT>|" &_
    "AgentRegion,align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>#AgentRegion#</FONT>|" &_
    "AgtAssignCell,align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>format=[(###)###-####]&nbsp;</FONT>|" &_

    "MgrConsultant, align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>#MgrConsultant#</FONT>| " &_

    "ClientFName,align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>#ClientFName#</FONT>|" &_
    "ClientLName,align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>#ClientLName#</FONT>|" &_
    "ClientTitle,align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>#ClientTitle#</FONT>|" &_
    "ClientAddr,align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>#ClientAddr#</FONT>|" &_
    "ClientCity,align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>#ClientCity#</FONT>|" &_
    "ClientState,align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>#ClientState#</FONT>|" &_
    "ClientZip,align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>#ClientZip#</FONT>|" &_
    "HomePhone,align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>format=[(###)###-####]&nbsp;</FONT>|" &_
    "WorkPhone,align=left,<FONT FACE='Arial' SIZE=2 COLOR=black>format=[(###)###-####]&nbsp;</FONT>|" &_

    MyDb.dbFormDisplayFlds = -1 'Hide all the fields from displaying

    MyDb.dbImageDir="../images/" 'Point to the "images" directory
    MyDb.dbStatusBar = false 'Turn off the status bar
    Mydb.dbMode = "form"

    Mydb.dbNavigationItem = "top, bottom, next, prev"
    Mydb.dbNavigationIcon = "std"
    Mydb.dbNavigation = "bottom"

    If Request("EMAILme") = "Send" then
    Mydb.dbNavigation = "none"
    End If

    Mydb.dbDisplay = False

    Mydb.ASPdb
    Mydb.ASPdbSendTemplate("rptAssgndConfLtrIn2.htm")
    TemplateFileName = Server.MapPath("rptAssgndConfLtrIn2.htm")


    %>

    <FORM>
    <%
    EMADDR = session("aspdb_600_AgtAssignEmail")
    %>
    <BR>
    <B>Email Addr:</B> <INPUT TYPE=TEXT SIZE=30 NAME=emailaddress VALUE= <% Response.write(" ") & EMADDR %> >
    <B>Optional Note:</B><INPUT TYPE=TEXT SIZE=25 NAME='EXTRA'>
    <B>Email Subject:</B><INPUT TYPE=TEXT SIZE=25 NAME=ESUB VALUE= "Letter from Relocation" >
    <INPUT TYPE="Submit" NAME="EMAILMe" VALUE="Send">
    </FORM>

    <%

    extra = " "
    if (Request("EXTRA") <> "") then
    extra = " " & Request("EXTRA") & "<HR>"
    SESSION("EXTRA_600") = extra
    end if

    If Request("EMAILme") = "Send" then

    'dbMail SYNTAX:
    'MSG = From|To|Cc|Bcc|Subject|Body|Format|Importance|Base |Location| Attach|Name1=value1,name2=value2..."

    Set Mail = Server.CreateObject("ASP.DB")

    EmailFrom = session("aspdb_10202_UserEmail")
    EmailTo = "|" & Request("emailaddress")
    EmailCC = "|"
    EmailBCC = "|"
    Subject = "| " & Request("ESUB")
    Body = "|Tmp=" & TemplateFileName

    MSG = "(|,)" & EmailFrom & EmailTo & EmailCC & EmailBCC & Subject & Body & "|0|1"

    Mail.dbMail = MSG

    Mail.ASPdbSendMail

    Response.write("<P> MAIL SENT. <P>")

    End If

    %>

    </BODY>

    </HTML>

  4. #4
    Join Date
    Oct 2002
    Posts
    933
    James,

    AS always, I need code that I can run and see the problem. Let me look at your first setup and if I couldn't make anythingout of it then you have to make a simple NWIND example to illustrate the problem.


    FK

  5. #5
    Join Date
    Oct 2002
    Posts
    93
    Hi Jim,

    Frank's right, NWind code would really help. However, looking at your code it appears the critical line is:

    <B>Email Addr:</B> <INPUT TYPE=TEXT SIZE=30 NAME=emailaddress VALUE= <% Response.write(" ") & EMADDR %> >

    right?

    If so, let's address what looks "strange" about that emailaddress part:

    1) The Response.write only writes out a space and then is closed (" "). Why isn't the EMADDR inside those parenthesis?

    2) Where's the quotes around the VALUE= section?

    3) Why do you want a leading space in there anyway?

    It seems like it should be more like:
    VALUE='<% =EMADDR %>' >

    or if you really want that space:
    VALUE='<% =" " & EMADDR %>' >

    and if you want to do it the long way:
    VALUE='<% Response.Write(" " & EMADDR) %>' >

    Let me know if I'm reading this right?

    Thanks,
    John

  6. #6
    Join Date
    Feb 2003
    Posts
    10
    John,

    You are exactly on the right track. I have replaced the text with your suggestion, and now in the field where the email address should be populated, I get "<font color=#0000cc>cornishcr@aol.com</font>" and what is stranger is that the email address it should be putting in is: "djackson@fastrealty.com".

    I'm the Jim Evans with the Relocation Specialist application and the page I'm trying to fix is: ...relospec/SQL/rptAssgndConfLtrIn2.asp

    Any ideas on this one?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •