hello. from what i can figure, i think that this bit of code i've posted below,
excluding the extended part about invalid email, could be entirely duplicated
by looping through an array... right?
<cfif isdefined("FORM.op")> <!--- FORM HAS BEEN SUBMITTED --->
<cfset variables.emptymsg = "</h1><ul>">
<cfset variables.cordial = "You failed to submit the following fields:"
& "#variables.emptymsg#">
<cfif FORM.name_first EQ ""> <!--- CHECK FOR FIELDS SET OR NO
VALUE --->
<cfset variables.emptymsg = variables.emptymsg &
"<li>#VARIABLES.qone#</li>">
<cfset variables.resub = 1>
<cfelse>
<cfset variables.name_first = #form.name_first#>
</cfif>
<cfif FORM.name_last EQ "">
<cfset variables.emptymsg = variables.emptymsg &
"<li>#VARIABLES.qtwo#</li>">
<cfset variables.resub = variables.resub + 1>
<cfelse>
<cfset variables.name_last = #form.name_last#>
</cfif>
<cfif form.password eq "">
<cfset variables.emptymsg = variables.emptymsg &
"<li>#VARIABLES.qthree#</li>">
<cfset variables.resub = variables.resub + 1>
<cfelse>
</cfif>
<cfif form.email eq ""><!--- IF THIS HOLDS HACK THEN THE
VAR.RESUB ABOVE GOES DOWN TO SCHOOLid --->
<cfset variables.emptymsg = variables.emptymsg &
"<li>#VARIABLES.qfour#</li>">
<cfset variables.resub = variables.resub + 1>
<cfelseif form.email NEQ "">
<cfif isEmail("form.email")>
<cfset form.email = variables.email>
<cfelse>
<cfset variables.invalimail= "<h3
style="color:yellow;font-family:monospace;"> -- INVALID EMAIL ADDRESS
DETECTED -- </h3>">
<cfset variables.email = "">
<cfset variables.invalimail = "<p></p>We're
sorry, but you must return to the form and try a different email address. Your
previous entry was either a unique e-mail address, which we've mistaken for
malicious code, or you are trying to submit hacker code.</p><p
class="fineprintmargin">If are not a participant of this program,
please close this web site now. Violators are subject to prosecution.</p>">
</cfif>
<cfelse>
<cfset variables.email = #form.email#>
</cfif>
<cfif form.school_id eq "">
<cfset variables.emptymsg = variables.emptymsg &
"<li>#VARIABLES.qfive#</li>">
<cfset variables.resub = variables.resub + 1>
<cfelse>
<cfset variables.school_id = #form.school_id#>
</cfif>
<cfif form.semester_code eq "">
<cfset variables.emptymsg = variables.emptymsg &
"<li>#VARIABLES.qsix#</li>">
<cfset variables.resub = variables.resub + 1>
<cfelse>
<cfset variables.semester_code = #form.semester_code#>
</cfif>
<cfif form.major eq "">
<cfset variables.emptymsg = variables.emptymsg &
"<li>#VARIABLES.qseven#</li>">
<cfset variables.resub = variables.resub + 1>
<cfelse>
<cfset variables.major = #form.major# >
</cfif>
<cfif form.minor eq "">
<cfset variables.emptymsg = variables.emptymsg &
"<li>#VARIABLES.qeight#</li>">
<cfset variables.resub = variables.resub + 1>
<cfelse>
<cfset variables.minor = #form.minor# >
</cfif>
<cfif form.extracur eq "">
<cfset variables.emptymsg = variables.emptymsg &
"<li>#VARIABLES.qnine#</li>">
<cfset variables.resub = variables.resub + 1>
<cfelse>
<cfset variables.extracur = #form.extracur# >
</cfif>
<cfif form.hometown_zip eq "">
<cfset variables.emptymsg = variables.emptymsg &
"<li>#VARIABLES.qten#</li>">
<cfset variables.resub = variables.resub + 1>
<cfelse>
<cfset variables.hometown_zip = #form.hometown_zip#>
</cfif>
<cfif form.highschool eq "">
<cfset variables.emptymsg = variables.emptymsg &
"<li>#VARIABLES.qeleven#</li>">
<cfset variables.resub = variables.resub + 1>
<cfelse>
<cfset variables.highschool = #form.highschool#>
</cfif>
<cfif form.stu_teach_sem eq "">
<cfset variables.emptymsg = variables.emptymsg &
"<li>#VARIABLES.qtwelve#</li>">
<cfset variables.resub = variables.resub + 1>
<cfelse>
<cfset variables.stu_teach_sem = #form.stu_teach_sem#>
</cfif>
<cfif form.stu_teach_loc eq "">
<cfset variables.emptymsg = variables.emptymsg &
"<li>#VARIABLES.qthirteen#</li>">
<cfset variables.resub = variables.resub + 1>
<cfelse>
<cfset variables.stu_teach_loc = #form.stu_teach_loc#>
</cfif>
<cfif form.exp_words eq "">
<cfset variables.emptymsg = variables.emptymsg &
"<li>#VARIABLES.qfourteen#</li>">
<cfset variables.resub = variables.resub + 1>
<cfelse>
<cfset variables.exp_words = #form.exp_words#>
</cfif>
<cfif form.post_grad eq "">
<cfset variables.emptymsg = variables.emptymsg &
"<li>#VARIABLES.qfifteen#</li>">
<cfset variables.resub = variables.resub + 1>
<cfelse>
<cfset variables.post_grad = #form.post_grad#>
</cfif>
<cfset variables.emptymsg = variables.emptymsg & "</ul>">
<cfelse>
</cfif>
i realize that we probably can't easily duplicate it ExactlY like it is here,
including my UL's and all...
if this can be done w/ an array, what would be the proper syntax for this
scenario? i'm mostly looking for tag-names, or function names specific to
cold-fusion which i'm far from having them memorized. ;)
thank you!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:241245
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54