Advertisement

09.08.2008 at 08:32PM PDT, ID: 23714277
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.2

Coldfusion form validation: Changing the "Subject" of an email based on server date/time

Asked by CurtinProp in Cold Fusion Markup Language

Tags: ,

Hi,

I've provided a basic coldfusion email template for you to edit if necessary.

In my validation I'd like to check the date / time on the server.

If the date entered into the form is within 24 hours of the server date / time then insert "Urgent" into the subject of the email.

Along with that I'd like to add a "read reciept to my email" if thast possible.

Thanks in advance.Start Free Trial
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:
<!--- Form variables here   --->
<cfparam name="FORM.FirstName" default="">
<cfparam name="FORM.LastName" default="">
<cfparam name="FORM.Email" default="">
<cfparam name="FORM.Phone" default="">
<cfparam name="FORM.Comments" default="">
<cfparam name="FORM.Action" default="">
<cfparam name="URL.Msg" default="">
<cfset VARIABLES.Msg="#URL.Msg#">
 
<cfif VARIABLES.Msg is "" and FORM.Action is "Submit">
  <!--- Validation --->
  <cfif Trim(FORM.FirstName) is "">
    <cfset VARIABLES.Msg=VARIABLES.Msg & "<li>You must enter your first name</li>">
  </cfif>
  <cfif Trim(FORM.LastName) is "">
    <cfset VARIABLES.Msg=VARIABLES.Msg & "<li>You must enter your last name</li>">
  </cfif>
  <cfif Trim(FORM.Email) is "">
    <cfset VARIABLES.Msg=VARIABLES.Msg & "<li>You must enter your Email Address</li>">
  </cfif>
  <cfif Trim(FORM.Phone) is "">
    <cfset VARIABLES.Msg=VARIABLES.Msg & "<li>You must enter your Phone Number</li>">
  </cfif>
  <cfif Trim(FORM.Comments) is "">
    <cfset VARIABLES.Msg=VARIABLES.Msg & "<li>You must describe your query</li>">
  </cfif>
  <!--- Process data mailto: --->
  <cfmail to="email@email.com"
           cc="#FORM.Email#"
                   from="SENDER"
           subject="SUBJECT" type="html">
    Dear #FirstName# The Following details have been processed: #Form.FirstName# #Form.LastName# #Form.Phone# #Form.Email# #Form.Comments#
  </cfmail>
  <cfif VARIABLES.Msg is "">
    <!--- Process finished either cf location or URLmessage --->
    <cflocation url="baseform.cfm?Msg=#URLEncodedFormat('Information validated & posted - Thank you!')#" addtoken="No">
  </cfif>
</cfif>
<!--- ERROR MESSAGE appears here above form  --->
<cfoutput>
  <cfif VARIABLES.Msg is not "">
    <ul>
      #VARIABLES.Msg#
    </ul>
  </cfif>
  <form action="baseform.cfm" method="POST" enctype="multipart/form-data">
    <table cellspacing="2" cellpadding="2" border="0" class="form_table">
      <tr>
        <th>* First Name:</th>
        <td><input type="text" class="inputbox" name="FirstName" message="" validateat="onServer" value="#FORM.FirstName#" size="30"></td>
      </tr>
      <tr>
        <th>* Last Name:</th>
        <td><input type="text" class="inputbox" name="LastName" message="" validateat="onServer" value="#FORM.LastName#" size="30"></td>
      </tr>
      <tr>
        <th>* Phone:</th>
        <td><input type="text" class="inputbox" name="Phone" message="" validateat="onServer" value="#FORM.Phone#" size="20"></td>
      </tr>
      <tr>
        <th>* Email:</th>
        <td><input type="text" class="inputbox" name="Email" message="" validateat="onServer" value="#FORM.Email#" size="30"></td>
      </tr>
      <tr>
        <th>Required Date:</th>
        <td><input type="text" id="SdDays" name="SdDays" value="" size="4" maxlength="2" class="inputbox">
          /
          <input type="text" id="SdMonths" name="SdMonths" value="" size="4" maxlength="2" class="inputbox">
          /
          <input type="text" id="SdYears" name="SdYears" value="" size="6" maxlength="4" class="inputbox">
        </td>
      </tr>
      <tr>
        <th>* Query:</th>
        <td><textarea name="Comments" class="inputbox" cols="40" rows="6" validateat="OnServer" message="" tooltip="tooltip in here" enabled="yes" value="#FORM.Comments#"></textarea></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td><input type="submit" name="Action" id="Submit" value="Submit">
          <input type="reset" value="Reset" id="Reset">
        </td>
      </tr>
    </table>
  </form>
</cfoutput>
[+][-]09.08.2008 at 08:34PM PDT, ID: 22424107

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Cold Fusion Markup Language
Tags: Coldfusion / Html, all
Sign Up Now!
Solution Provided By: Plucka
Participating Experts: 1
Solution Grade: A
 
 
[+][-]09.08.2008 at 08:52PM PDT, ID: 22424173

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628