Solved

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

Posted on 2002-04-12
3
126 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

695 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