Bizarre CFIF issue with dynamic form variables? Very strange...
I can't figure out what I'm doing wrong here. Here's my code. Issue explained below.
<cfquery name="reviewconfigloader" datasource="MOLMS">
SELECT *
FROM dbo.BaseModel
WHERE dbo.BaseModel.AccountID = #molmsAccountID# AND.dbo.BaseModel.basemodelActive = 1
</cfquery>
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<cfloop query="reviewconfigloader"><cfif isdefined("form.baseconfig#reviewconfigloader.basemodelID#") AND ("form.baseconfig#reviewconfigloader.basemodelID#") NEQ "" AND ("form.baseconfig#reviewconfigloader.basemodelID#") NEQ 0><cfoutput><tr>
<td width="40%" bgcolor="##F7F7F7" class="basemodelsub"> #form['baseconfig#reviewconfigloader.basemodelID#']# #reviewconfigloader.basemodelName# #reviewconfigloader.basemodelSubName#</td>
<td width="15%" bgcolor="##F7F7F7" class="basemodelsub"><div align="center">x 14 </div></td>
<td width="15%" bgcolor="##F7F7F7" class="basemodelsub"><div align="center">$486/yr</div></td>
<td width="15%" bgcolor="##F7F7F7" class="basemodelsub"><div align="center">$1444/yr</div></td>
<td width="15%" bgcolor="##F7F7F7" class="basemodelsub"><div align="center">$1444/3 yr</div></td>
</tr></cfoutput></cfif></cfloop>
</table>
What I'm doing here is fairly basic.I'm running a query with a number of configs in it...and then creating a loop to output them. Ultimately, I only want the configurations that didnt have 0 submitted in the form on the previous page. Each one of the configs in the config query has a dynamic form variable on the previous page with a quantity tied to it. I am trying to eliminate all quantities past that aren't 0 (or not eliminate, just not show)...as you can see from the cfif statement.
Here's where it gets weird. You'll notice I output #form['baseconfig#reviewconfigloader.basemodelID#']#, just for testing, which shows me the quantity as it should. I ran a test and put in a couple of 1s, 0s, 12s, 6s, etc in the form fields on the previous page. If this thing worked, it wouldnt show anything for any of the records with their basemodelID value being submitted as 0. Not the case. It shows all records. What is more hilarious is that it outputs perfectly in my test #form['baseconfig#reviewconfigloader.basemodelID#']#, showing the correct numbers entered in the previous form, the 1s, the 0s, etc, tied to each record. But for whatever reason, the cfif code isn't catching it.
What's even more bizarre...I replaced the cfif ("form.baseconfig#reviewconfigloader.basemodelID#") NEQ 0 with GT 12 (12 was the highest number that I put in the form) and it still showed all records. Then I put it in as LT 12 and it showed nothing. I decided to take it one step further and put it in for GT 1231243242343 (random massive number), which it still showed all of the records. So somehow, my CFIF statement thinks that ("form.baseconfig#reviewconfigloader.basemodelID#") is a incredibly large number, although when I output it in the row below, it is the number it should be.
I'm stumped. Any ideas? Thanks in advance!!
