evergreean43
Technical User
I have a URL that comes up in a search results page where it shows next record. It works great but I need more efficient way to test conditions. I have 10 search fields that could be entered and I check if each one is defined in the url. Here is an example just showing 2 out of my 10 conditions on the url:
I am trying to put it in a loop but cant get it working. I get errors on the loop with the index value and the url argument not valid. Please advise.
Code:
<a href="results.cfm?myStartRow=#mystartRowVar#<cfif isDefined('city')>&city=#city#</cfif>#<cfif isDefined('state')>&state=#state#</cfif>">Next</a>
I am trying to put it in a loop but cant get it working. I get errors on the loop with the index value and the url argument not valid. Please advise.
Code:
<cfset mylist = "">
<cfoutput>
<cfloop list="#fieldnames#" index="i">
<cfif isDefined('#i#')>
<cfset mylist = listAppend(mylist, i &"="& #i#, "&")>
</cfif>
</cfloop>
<cfoutput>
...
<a href="results.cfm?myStartRow=#mystartRowVar##mylist#">Next</a>