Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap

Q3009 How can I make sure that required and/or optional parameters are passed to my ColdFusion template?

You are here: irt.org | FAQ | ColdFusion | Q3009 [ previous next ]

Use the following script:

<!--- optional parameters --->
<cfparam name="optParam1" default="true">
<cfparam name="optParam2" default="">

<!--- required parameters --->
<CFLOOP index="param" list="optParam1,optParam2">
	<CFIF Evaluate(param) EQ "">
		<H4>Missing Parameter</H4>

		You need to specify a value for the '<B><CFOUTPUT>#param#</CFOUTPUT></B>' parameter. This parameter is required.

©2018 Martin Webb