PageRenderTime 4ms CodeModel.GetById 2ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/SampleApplication/ColdBox3/views/enquiry/index.cfm

http://github.com/bobsilverberg/ValidateThisColdBoxPlugin
ColdFusion | 42 lines | 39 code | 3 blank | 0 comment | 0 complexity | dc13c77c9b99590297cf715dfac09a52 MD5 | raw file
 1<cfoutput>
 2<h1>Enquiry</h1>
 3
 4<cfif rc.ValidationResult.hasErrors()>
 5	<div class="messagebox">
 6		The following problems were found with your form submission:
 7		<ul>
 8			<cfloop array="#rc.ValidationResult.getFailures()#" index="failure">
 9				<li>#failure.Message#</li>
10			</cfloop>
11		</ul>
12	</div>
13</cfif>
14
15<form action="#Event.BuildLink( 'enquiry.send' )#" method="post">
16	<table>
17		<tr>
18			<th>Firstname <cfif StructKeyExists( rc.RequiredFields, "firstname" )><span class="required">*</span></cfif></th>
19			<td><input type="text" name="firstname" id="firstname" value="#HtmlEditFormat( rc.Enquiry.getFirstname() )#" /> <cfif rc.ValidationResult.hasErrors( "firstname" )>Error!</cfif></td>
20		</tr>
21		<tr>
22			<th>Surname <cfif StructKeyExists( rc.RequiredFields, "lastname" )><span class="required">*</span></cfif></th>
23			<td><input type="text" name="lastname" id="lastname" value="#HtmlEditFormat( rc.Enquiry.getLastname() )#" /> <cfif rc.ValidationResult.hasErrors( "lastname" )>Error!</cfif></td>
24		</tr>
25		<tr>
26			<th>Email <cfif StructKeyExists( rc.RequiredFields, "email" )><span class="required">*</span></cfif></th>
27			<td><input type="text" name="email" id="email" value="#HtmlEditFormat( rc.Enquiry.getEmail() )#" /> <cfif rc.ValidationResult.hasErrors( "email" )>Error!</cfif></td>
28		</tr>
29		<tr>
30			<th>Message <cfif StructKeyExists( rc.RequiredFields, "message" )><span class="required">*</span></cfif></th>
31			<td><input type="text" name="message" id="message" value="#HtmlEditFormat( rc.Enquiry.getMessage() )#" /> <cfif rc.ValidationResult.hasErrors( "message" )>Error!</cfif></td>
32		</tr>
33		<tr>
34			<th>&nbsp;</th>
35			<td>
36				<input type="submit" name="send" id="send" value="send" />
37			</td>
38		</tr>
39	</table>
40</form>
41
42</cfoutput>