Solved

How do you pass a numeric string value from one form to another form

Posted on 2002-04-12
3
122 Views
Last Modified: 2013-12-24
I can pass two parameter (busgroup_id & dept_id) from one form to the next using the code below when the values are hard coded:

<td height="18"><font face="Arial, Helvetica, sans-serif" size="2"><a href="../document_view_gplist.cfm?busgroup_id=2&dept_id=17">HO</a></font></td>

What I would like to do is pass two parameters one of which is a numeric string, rsGroup__var3 (I would also be intrested in finding out how to do a text string) from one form to the next.

I have tried this code, without success:

<td height="18"><font face="Arial, Helvetica, sans-serif" size="2"><a href="../document_view_gplist.cfm?busgroup_id=#rsGroup__var3#&dept_id=17">HO</a></font></td>

Can anyone tell me how to do this?

Thanks,
0
Comment
Question by:kenmck
  • 2
3 Comments
 
LVL 14

Expert Comment

by:Scott Bennett
ID: 6937176
What you are trying should work, but make sure the variable name is correct and that you have <cfoutput> tags.


Like this:

<cfset rsGroup__var3 = 1>

<cfoutput>
<td height="18"><font face="Arial, Helvetica, sans-serif" size="2"><a href="../document_view_gplist.cfm?busgroup_id=#rsGroup__var3#&dept_id=17">HO</a></font></td>
</cfoutput>


Then on document_view_gplist.cfm you should be able to access the variable as #url.busgroup_id#
0
 
LVL 5

Expert Comment

by:harwantgrewal
ID: 6937516
When ever you want to display the output of a variable use
<cfoutput>#var_name#</cfoutput>

and you dont have to worry about the numeric value suppose this is the test code

<cfset rsGroup__var3=4>

<td height="18"><font face="Arial, Helvetica, sans-serif" size="2"><a href="../document_view_gplist.cfm?busgroup_id=<cfoutput>#rsGroup__var3#</cfoutput>&dept_id=17">HO</a></font></td>

in document_view_gplist.cfm you can do this calculation


<cfset add=1+rsGroup_var3>
<cfoutput>#add#</cfoutput>

in case of text string here is eg

<cfset text_var="This is the test put as long as string here ">


<td height="18"><font face="Arial, Helvetica, sans-serif" size="2"><a href="../document_view_gplist.cfm?busgroup_id=<cfoutput>#rsGroup__var3#</cfoutput>&dept_id=17">HO</a></font></td>

in document_view.gplist.cfm file you just do

<cfoutput>#rsGroup_var3#</cfoutput>
you will get whloe text
Harry
0
 
LVL 14

Accepted Solution

by:
Scott Bennett earned 100 total points
ID: 6937557
In ColdFusion variable are typless, which means when you do this:

<cfset x = "1">

It is the same as this:

<cfset x = 1>

The value will automatically be translated between datatypes by coldfusion.

So you can then use "x" as a string or as a number.

However if you are passing a variable that may contain characters that would not be compatible with a url you should use URLEncodedFormat()

Like this:

<cfset rsGroup__var3 = 1>
<cfset another_variable = "I like Apples & Bananas!">

<cfoutput>
<td height="18"><font face="Arial, Helvetica, sans-serif" size="2"><a href="../document_view_gplist.cfm?busgroup_id=#rsGroup__var3#&dept_id=17&Another_URL_Variable=#URLEncodedFormat(another_variable)#">HO</a></font></td>
</cfoutput>
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question