Problem with a structure, how to set a conditional variable inside
not sure if titled correctly, have created structre:
<cfset email.fields[1] = structnew()>
<cfset email.fields[1].required = true>
<cfset email.fields[1].label = 'county email address'>
<cfset email.fields[1].displayicon = false>
<cfset email.fields[1].regex = "^.+@jason.com$">
<cfset email.fields[1].externalsource = newexternalsource()>
the line taht bolded , underlined line having issues with. have set variable particular email address, , way struct set up, users allowed enter email address. issue is, particular client has 2 email address users can enter. not sure how accomplish within structure, if possible @ all. example, here do, although syntax incorrect:
<cfset email.fields[1].regex = "^.+@jason.com$" or "^.+@tommy.com$">
i don't think you're approaching right direction. you're not wanting set value conditionally on something, want regex match both email addresses.
for example, it'd be:
^.+@(jason|tommy)\.com$
(note existing regex wrong, in should escaping "." in ".com". have reflected correct approach in example.
--
adam
More discussions in ColdFusion
adobe
Comments
Post a Comment