Solved

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

Posted on 2002-04-12
3
121 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

Superior storage. Superior surveillance.

WD Purple drives are built for 24/7, always-on, high-definition security systems. With support for up to 8 hard drives and 32 cameras, WD Purple drives are optimized for surveillance.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
json_decode return null? 8 69
OpenLDAP set password to expire 7 524
Problem to Eclipse 16 116
Autoresponder for Whole Domain in Plesk/Cpanel 2 68
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…
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.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

932 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

10 Experts available now in Live!

Get 1:1 Help Now