Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shorten link conditions

Status
Not open for further replies.

toyt78

Technical User
Apr 5, 2005
125
0
0
US
I have a Search Results page in MX 6.0 that has a link to a report that includes all the search criteria and it works great.

Here is my link now where I shortened to 3 variables for this post but I am actually checking 10 variables on my page:
Code:
<a href="report.cfm?<cfif len(trim(form.varOne))>varOne=#varOne#</cfif><cfif len(trim(form.varOne))>&varTwo=#varTwo#</cfif>><cfif len(trim(form.Three))>&varThree=#varThree#</cfif>">Report link</a>

Please advise how I can shorten this or do it more efficiently??

 

I made a typo on the code. Here is correct one:
Code:
<a href="report.cfm?<cfif len(trim(form.varOne))>varOne=#varOne#</cfif>
<cfif len(trim(form.varTwo))>&varTwo=#varTwo#</cfif>>
<cfif len(trim(form.Three))>&varThree=#varThree#</cfif>">Report link</a>
 
why not just include them all. if they don't have values it'll just look like this

report.cfm?varone=&vartwo=iHaveAValue&varthree=&varfour= ....

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top