Conditional Statements in CDONTS

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default Conditional Statements in CDONTS

    Hi,

    I have CDONTS working great but have a small problem. There is a question
    with a checkbox as answer in the form that generates the email. If it is
    ticked, the value is 'yes' in the email, if not, it is blank.

    Is it possible to put a conditional statement within CDONTS email body to
    say 'if value is blank, write "no" ?


    Mintyman Guest

  2. Similar Questions and Discussions

    1. If Statements????
      guys i was wondering if anybody here could help me. I have a page done up with all dynamic text and attributes on it that come from a management...
    2. Conditional sum?
      FMP6, MacOSX.2 I've created a calc field using the aggregate Sum(score) to give me a "total points scored" for all related records in a...
    3. conditional sql statements
      I have a shopping cart that I want to load items in that come from a huge scrolling form. In other words, when someone clicks on a category in our...
    4. "OR" statements allowed in MultipleIf conditional regions in templates?
      Does DMX allow the addition of an "OR" condition on a MultipleIf conditional region: Thus displaying the same output for two different conditions? ...
    5. If/else statements - help.
      Sorry to post so much code all at once but I'm banging my head against the wall trying to get this to work! Does anyone have any idea where I'm...
  3. #2

    Default Re: Conditional Statements in CDONTS

    If Request.Form("formname") = "" Then
    strVal1 = "No"
    End If

    Then add strVal1 to your body.
    --
    __________________________________________________ __________________
    UltraSuite Extension Packages: [url]http://www.ultrasuite.com/[/url]
    The *most popular* Suites of DMX 2004 and DMX Server Behaviors
    for ASP, ASP.Net, ColdFusion, JSP, and PHP_MySQL
    __________________________________________________ __________________


    J.S. \(UltraSuite\) Guest

  4. #3

    Default Re: Conditional Statements in CDONTS

    Thanks for this. However, I cannot seem to get it working. Here is the code
    once I have entered what you suggested. Can you see why it is not working?

    <% If Trim(Request.Form("submit")) <> "" Then %>
    <% If Request.Form("hazardous") = "" Then
    strVal1 = "no"
    End If %>

    <%
    Set mail = Server.CreateObject("CDONTS.NewMail")

    mail.From = "user@domain.com"
    mail.To = "user@domain.com"
    mail.subject ="Return Authorisation Number Allocated"
    mail.body = "<table width=""600"" border=""0"" cellspacing=""0""
    cellpadding=""0"">" & "<tr>" & "<font face=Arial size=2>" & "The contact
    detailed below has just submitted a request for a RAN. Their details are:" &
    "<br><br>" & "</tr>" & "<tr>" & "<b>Name:</b> " &
    Trim(Request.Form("contact_name")) & "</tr>" & "<tr>" & "<b>Job Title:</b> "
    & Trim(Request.Form("job_title")) & "</tr>" & "<tr>" & "<b>Company:</b> " &
    Trim(Request.Form("organisation")) & "</tr>" & "<tr>" & "<b>Email:</b> " &
    "<a href=" & """mailto:" & Trim(Request.Form("email")) & """>" &
    Trim(Request.Form("email")) & "</a>" & "</tr>" & "<tr>" & "<b>Tel:</b> " &
    Trim(Request.Form("tel")) & "</tr>" & "<tr>" & "<b>Address1:</b> " &
    Trim(Request.Form("address1")) & "</tr>" & "<tr>" & "<b>Address2:</b> " &
    Trim(Request.Form("address2")) &"</tr>" & "<tr>" & "<b>City:</b> " &
    Trim(Request.Form("city")) & "</tr>" & "<tr>" & "<b>County:</b> " &
    Trim(Request.Form("county")) & "</tr>" & "<tr>" & "<b>Postcode:</b> " &
    Trim(Request.Form("postcode")) & "</tr>"& "<tr>" & "<b>Country:</b> " &
    Trim(Request.Form("country")) & "</tr>" & "<br><tr>" & "<b>Equipment
    Type:</b> " & Trim(Request.Form("equipment_type")) & "</tr>" & "<tr>" &
    "<b>Part Number:</b> " & Trim(Request.Form("part_number")) & "</tr>" &
    "<tr>" & "<b>Serial Number:</b> " & Trim(Request.Form("serial_number")) &
    "</tr>" & "<tr>" & "<b>Failure Date:</b> " &
    Trim(Request.Form("failure_date")) & "</tr>" & "<tr>" & "<b>materials
    processed:</b> " & Trim(Request.Form("substances")) & "</tr>" & "<tr>" &
    "<b>Hazardous?:</b> " & Trim(Request.Form("hazardous")) & Request("strVal1")
    & "</tr>" & "<tr>" & "<b>Return Reason:</b> " &
    Trim(Request.Form("Returns_Reason")) & "</tr>" & "<tr>" & "<b>Warranty
    Claim?:</b> " & Trim(Request.Form("warranty_claim")) & "</tr>" & "</font>" &
    "</table>"

    mail.MailFormat = 0
    mail.BodyFormat = 0

    mail.Send
    Set mail = nothing
    %>
    <%End If%>




    "J.S. (UltraSuite)" <ultrasuite@nospam.com> wrote in message
    news:cuv820$bik$1@forums.macromedia.com...
    > If Request.Form("formname") = "" Then
    > strVal1 = "No"
    > End If
    >
    > Then add strVal1 to your body.
    > --
    > __________________________________________________ __________________
    > UltraSuite Extension Packages: [url]http://www.ultrasuite.com/[/url]
    > The *most popular* Suites of DMX 2004 and DMX Server Behaviors
    > for ASP, ASP.Net, ColdFusion, JSP, and PHP_MySQL
    > __________________________________________________ __________________
    >
    >

    Mintyman Guest

  5. #4

    Default Re: Conditional Statements in CDONTS

    In the body you don't need:
    Request("strVal1")
    You just need:
    strVal1
    which has already been defined previously.

    --
    __________________________________________________ __________________
    UltraSuite Extension Packages: [url]http://www.ultrasuite.com/[/url]
    The *most popular* Suites of DMX 2004 and DMX Server Behaviors
    for ASP, ASP.Net, ColdFusion, JSP, and PHP_MySQL
    __________________________________________________ __________________


    J.S. \(UltraSuite\) Guest

  6. #5

    Default Re: Conditional Statements in CDONTS

    Many thanks :o)

    "J.S. (UltraSuite)" <ultrasuite@nospam.com> wrote in message
    news:cv0tir$2ha$1@forums.macromedia.com...
    > In the body you don't need:
    > Request("strVal1")
    > You just need:
    > strVal1
    > which has already been defined previously.
    >
    > --
    > __________________________________________________ __________________
    > UltraSuite Extension Packages: [url]http://www.ultrasuite.com/[/url]
    > The *most popular* Suites of DMX 2004 and DMX Server Behaviors
    > for ASP, ASP.Net, ColdFusion, JSP, and PHP_MySQL
    > __________________________________________________ __________________
    >
    >

    Mintyman Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139