Solved

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

Posted on 2002-04-12
3
120 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:SBennett
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:
SBennett 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now