coldfusion processing on submit question
Could someone explain coldfusion processing to me. This example from the documentation implies that the <ciif will be executed when the submit occurs. But doesn't the server just process the form on a submit ? I don't understand how the <cfif gets executed. Thanks
<h3>cfmail Example</h3>
<!--- Delete the surrounding comments to use this example.
<cfif IsDefined("form.mailto")>
<cfif form.mailto is not "" AND form.mailfrom is not "" AND form.Subject is not "">
<cfmail to = "#form.mailto#" from = "#form.mailFrom#" subject = "#form.subject#">
This message was sent by an automatic mailer built with cfmail:
= = = = = = = = = = = = = = = = = = = = = = = = = = =
#form.body#
</cfmail>
<h3>Thank you</h3>
<p>Thank you, <cfoutput>#mailfrom#: your message, #subject#, has been sent to
#mailto#</cfoutput>.</p>
</cfif>
</cfif>
<p>
<form action = "cfmail.cfm" method="POST">
<pre>
TO: <input type = "Text" name = "MailTo">
FROM: <input type = "Text" name = "MailFrom">
SUBJECT: <input type = "Text" name = "Subject">
<hr>
MESSAGE BODY:
<textarea name ="body" cols="40" rows="5" wrap="virtual"></textarea>
</pre>
<!--- Establish required fields. --->
<input type = "hidden" name = "MailTo_required" value = "You must enter a recipient">
<input type = "hidden" name = "MailFrom_required" value = "You must enter a sender">
<input type = "hidden" name = "Subject_required" value = "You must enter a subject">
<input type = "hidden" name = "Body_required" value = "You must enter some text">
<p><input type = "Submit" name = ""></p>
</p>
</form>
http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7f8e.html
