Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Other Programming > VBScript
|
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old August 12th, 2003, 11:54 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 119
Thanks: 0
Thanked 1 Time in 1 Post
Default Syntax question please.

I have this VBScript code in my ASP and I am wanting to type out the word "Yes" if the checkbox is "on" but I am getting syntax errors that I can't seem to correct. Any help would be appreciated. Here is the code I am trying to run:

strmessage = Request.Form("RegData")

Set objUser = Server.CreateObject("PropertyStore.ASPVars")
strmessage = strmessage & _
"***** Online Registration *****" & vbCRLF & _
"Internet Access in Office: & " & If Request.Form("I_Office_Access") = "on" Then Response.Write("Yes") End If & vbCRLF & _
"Practice Name: " & Request.Form("organization") & vbCRLF & _
"Alt Practice Name: " & Request.Form("organization_name") & vbCRLF & _
"Last Name: " & Request.Form("Last_Name") & vbCRLF & _
"First Name: " & Request.Form("First_Name") & vbCRLF & _
"Middle Initial: " & Request.Form("MI") & vbCRLF & _
"Title: " & Request.Form("title") & vbCRLF & _
"Specialty: " & Request.Form("Specialty") & vbCRLF & _
"Address 1: " & Request.Form("Address_1") & vbCRLF & _
"Suite: " & Request.Form("Suite") & vbCRLF & _
"City: " & Request.Form("city") & vbCRLF & _
"State: " & Request.Form("State") & vbCRLF & _
"Zip: " & Request.Form("Zip") & vbCRLF & _
"Phone: " & Request.Form("Phone") & vbCRLF & _
"Fax: " & Request.Form("Fax") & vbCRLF & _
"Challenge Answer: " & Request.Form("Answer") & vbCRLF & _
"Registered At Website: " & strURL & vbCRLF

'***** Distinguish where to send email when registration complete from a particular server. *****
'If InStr(1, LCase(Request.ServerVariables("SERVER_NAME")), "www.dontcare.net") > 0 Then
If len(1, strURL, "www.dontcare") > 0 Then
    objUser.Mail strmessage,"CareGate Registration for Physician","melindasavoy@texashealth.org"
    End If
Reply With Quote
  #2 (permalink)  
Old August 12th, 2003, 12:32 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 184
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Jonax
Default

You are in the process of filling (concatenating) the variable 'strmessage' where your have inserted you if-then.

Code:
strmessage = Request.Form("RegData")

Set objUser = Server.CreateObject("PropertyStore.ASPVars")
strmessage = strmessage & _
"***** Online Registration *****" & vbCRLF & _
"Internet Access in Office: "

If Request.Form("I_Office_Access") = "on" Then 
    strMessage = strMessage & "Yes"
'Else
'    strMessage = strMessage & "No"
End If

strMessage = strMessage & vbCRLF & _
"Practice Name: " & Request.Form("organization") & vbCRLF & _
"Alt Practice Name: " & Request.Form("organization_name") & vbCRLF & _
"Last Name: " & Request.Form("Last_Name") & vbCRLF & _
"First Name: " & Request.Form("First_Name") & vbCRLF & _
"Middle Initial: " & Request.Form("MI") & vbCRLF & _
"Title: " & Request.Form("title") & vbCRLF & _
"Specialty: " & Request.Form("Specialty") & vbCRLF & _
"Address 1: " & Request.Form("Address_1") & vbCRLF & _
"Suite: " & Request.Form("Suite") & vbCRLF & _
"City: " & Request.Form("city") & vbCRLF & _
"State: " & Request.Form("State") & vbCRLF & _
"Zip: " & Request.Form("Zip") & vbCRLF & _
"Phone: " & Request.Form("Phone") & vbCRLF & _
"Fax: " & Request.Form("Fax") & vbCRLF & _
"Challenge Answer: " & Request.Form("Answer") & vbCRLF & _
"Registered At Website: " & strURL & vbCRLF

'*****    Distinguish where to send email when registration complete from a particular server. *****
'If InStr(1, LCase(Request.ServerVariables("SERVER_NAME")), "www.dontcare.net") > 0 Then
If len(1, strURL, "www.dontcare") > 0 Then
    objUser.Mail strmessage,"CareGate Registration for Physician","melindasavoy@texashealth.org"
End If
Reply With Quote
  #3 (permalink)  
Old August 12th, 2003, 12:41 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 119
Thanks: 0
Thanked 1 Time in 1 Post
Default

Thank you very much. I will try that.

Your time is appreciated.


Quote:
quote:Originally posted by Jonax
 You are in the process of filling (concatenating) the variable 'strmessage' where your have inserted you if-then.

Code:
strmessage = Request.Form("RegData")

Set objUser = Server.CreateObject("PropertyStore.ASPVars")
strmessage = strmessage & _
"***** Online Registration *****" & vbCRLF & _
"Internet Access in Office: "

If Request.Form("I_Office_Access") = "on" Then 
    strMessage = strMessage & "Yes"
'Else
'    strMessage = strMessage & "No"
End If

strMessage = strMessage & vbCRLF & _
"Practice Name: " & Request.Form("organization") & vbCRLF & _
"Alt Practice Name: " & Request.Form("organization_name") & vbCRLF & _
"Last Name: " & Request.Form("Last_Name") & vbCRLF & _
"First Name: " & Request.Form("First_Name") & vbCRLF & _
"Middle Initial: " & Request.Form("MI") & vbCRLF & _
"Title: " & Request.Form("title") & vbCRLF & _
"Specialty: " & Request.Form("Specialty") & vbCRLF & _
"Address 1: " & Request.Form("Address_1") & vbCRLF & _
"Suite: " & Request.Form("Suite") & vbCRLF & _
"City: " & Request.Form("city") & vbCRLF & _
"State: " & Request.Form("State") & vbCRLF & _
"Zip: " & Request.Form("Zip") & vbCRLF & _
"Phone: " & Request.Form("Phone") & vbCRLF & _
"Fax: " & Request.Form("Fax") & vbCRLF & _
"Challenge Answer: " & Request.Form("Answer") & vbCRLF & _
"Registered At Website: " & strURL & vbCRLF

'*****    Distinguish where to send email when registration complete from a particular server. *****
'If InStr(1, LCase(Request.ServerVariables("SERVER_NAME")), "www.dontcare.net") > 0 Then
If len(1, strURL, "www.dontcare") > 0 Then
    objUser.Mail strmessage,"CareGate Registration for Physician","melindasavoy@texashealth.org"
End If
Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
Another newb syntax question mean34dean Access VBA 4 April 4th, 2008 07:45 AM
SQL Syntax question ThomasWikman BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 4 May 7th, 2007 01:25 AM
syntax question Tachyon Beginning PHP 4 July 14th, 2004 07:40 PM
sql access syntax question using "LIKE" katie456 SQL Server 2000 3 October 10th, 2003 05:49 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.