CFQUERY named "getColumns" statement here.
The following code works for CF generated "Required"
attribute validation:
<cfform action="" method="post">
<cfoutput query="getColumns">
<cfset reqYN = IIF(nul IS NOT
'YES',DE('yes'),DE('no'))>
#column_name#: <cfinput type="text"
name="#column_name#" required="#reqYN#"> <BR>
</cfoutput>
<P>
<input type="submit" name="send" value="Go">
</cfform>
The following more complex code won't:
<cfform action="" method="post">
<cfoutput query="getColumns">
<cfset reqYN = IIF(nul IS NOT
'YES',DE('yes'),DE('no'))>
-- the IIF function can be embedded into the <CFINPUT
element but I chose not
#column_name#:
<cfif ...>
<cfinput type="text" name="#column_name#"
required="#reqYN#">
other stuff like field Help or not here <BR>
<cfelse>
...
</cfif>
</cfoutput>
<P>
<input type="submit" name="send" value="Go">
</cfform>
Why?
Secondly, there are two types of validations,
1) field required or not, msg responds to that;
2) field data_type, msg responds to that.
But there's only one Message attribute.
What's a good systematic way to address it?
Thanks.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.
http://www.cfhosting.com
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4