BKBK,
Yes, this works too: <cfif refindnocase("^[cC][0-9]{4}", "form.Part_Number#id#") GT 0>. Just had to remove the [] and put a dot after form. But I'm still having an issue with the If statement not outputting "Yes!!!". Even if I try and with an exact part number, the If statement still outputs "No!!!". Here's what I tried:
<cfif "form.Part_Number#id#" IS 'P15552A'>
YES!!!
<cfelse>
NO!!!</cfif>
I'm guessing it has to do something with the #id#. I do have this also for where the id comes from:
<cfloop index="id" list="#form.listofids#" delimiters=",">
I really don't remember why we needed this id, but I think it was because of the way our database was set up. Do you have any ideas as to how to even get the If Statement above to output "Yes!!!"? If that works, then I could incorporate the refindnocase code.
Andy
jamie61880 wrote: Do you have any ideas as to how to even get the If Statement above to output "Yes!!!"? |
Yes. Sorry there was a typing error in my last post. Those lines should be, respectively,
<cfif left(form["Part_Number#id#"],1) EQ "C" AND refindnocase("^[cC][0-9]", form["Part_Number#id#"])>
and
<cfif refindnocase("^[cC][0-9]{4}", form["Part_Number#id#"]) GT 0>
You are having difficulties because of <cfif "form.Part_Number#id#" IS 'P15552A'>. Observe that "form.Part_Number#id#" is not necessarily the value of a form field. It is just a string containing the characters f, o, r, and so on. What you want is
<cfif form["Part_Number#id#"] IS 'P15552A'>
Even better:
<cfset partNumberField = "Part_Number" & id>
<cfif form[partNumberField] IS 'P15552A'>