ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 23rd, 2005, 09:07 AM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 272 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 8 m 8 sec
Reputation Power: 4
Strange Behavior Passing Varaibles...

Hey all, so i'm passing a variable from one page to another...i've done this so many times I have no idea why this isn't working...

here's the code.

<a href="more.cfm?portID=#Criteria#">More of this type</a>

when I do a cfdump on the page, I get "trump" when I click the link and do a cfdump there, I get "[empty string]"

I have no idea why the information is getting lost inbetween pages...any ideas?

Reply With Quote
  #2  
Old May 23rd, 2005, 09:32 AM
mlearn mlearn is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 13 mlearn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 58 m 12 sec
Reputation Power: 0
It might help to have a little more of the code around the sending page and on the receiving page. Do you perhaps set the value of portID on the second page before you dump it? On the calling page is there more that one variable called Criteria (maybe different scopes) that might be confusing CF?

It would just help to have a little more code to look at... Else, I do not see anything here that would indicate something wrong...

-Matt
http://www.LearnFamily.com

Reply With Quote
  #3  
Old May 23rd, 2005, 09:36 AM
hanleyk1's Avatar
hanleyk1 hanleyk1 is offline
recovering whitewater addict
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Lexington, you guess the state
Posts: 255 hanleyk1 User rank is Corporal (100 - 500 Reputation Level)hanleyk1 User rank is Corporal (100 - 500 Reputation Level)hanleyk1 User rank is Corporal (100 - 500 Reputation Level)hanleyk1 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 3 Days 19 h 10 m 51 sec
Reputation Power: 8
Frequently when I have had problems of this sort, the placement or syntax of my cfoutput tags have been the culprit. In order to try to determine what the problem is here, I think we need to see a fair amount of the surrounding code.

Reply With Quote
  #4  
Old May 23rd, 2005, 10:53 AM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 272 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 8 m 8 sec
Reputation Power: 4
<cfset criteria="#form.criteria#">

so, i've tried setting it into a variable, or pulling it right out of the cfsearch directly...and neither have worked

Reply With Quote
  #5  
Old May 23rd, 2005, 10:57 AM
mlearn mlearn is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 13 mlearn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 58 m 12 sec
Reputation Power: 0
Wait.. if you are trying to use form.criteria, that would be a problem. You should be using url.criteria... You are passing the variable in as a URL variable and not a FORM variable....

Check that out...

If that does not help, do a CFDUMP of the FORM and URL variables...

-Matt
http://www.LearnFamily.com

Reply With Quote
  #6  
Old May 23rd, 2005, 11:03 AM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 272 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 8 m 8 sec
Reputation Power: 4
that does not work either...and when I put the form.criteria into a variable and cfdump it, I get the correct result, so then adding that variable to send to the next page, should realistically be fine.

Reply With Quote
  #7  
Old May 23rd, 2005, 11:16 AM
mlearn mlearn is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 13 mlearn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 58 m 12 sec
Reputation Power: 0
Ok, let's assume that the varialbe does get passed correctly, first of all, do you see the variable correctly in the URL? (does it have spaces or anything funny that might need to be URLEncoded?)

On the second page, what happens when you do a cfdump on the URL variable? Is the portID there? I guess it just helps to see where you are using the variable on the second page...

Don't know what else to say without more information... Hope that we can find a way to help you out...

-Matt

Reply With Quote
  #8  
Old May 23rd, 2005, 11:23 AM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 272 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 8 m 8 sec
Reputation Power: 4
in the URL it appears fine...

in the following page when I do a cfdump on URL.PortID I get [Empty String]

Reply With Quote
  #9  
Old May 23rd, 2005, 11:26 AM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 272 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 8 m 8 sec
Reputation Power: 4
Although...when I use the same technique to pass an ID across, when I scroll over the link i'll see the ID it's about to pass, not #ID#

in this case, I see #form.criteria# when I roll over the link and in the URL of the following page, which makes me beleive something isn't right from the get go, but it all seems fine to me...

Code:
<cfset criteria="#form.criteria#">
<cfsearch 
   name = "name"
   collection = "numberonerulen"
   criteria = "#Form.Criteria#">

 <cfdump var="#criteria#">
	     <div align="right"><a href="more.cfm?portID=#form.criteria#">More of this type</a> 
             <!-- End Topic -->

that's the code that effects it, everything else around it really is HTML...

Reply With Quote
  #10  
Old May 23rd, 2005, 11:36 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,681 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 15 h 22 m 41 sec
Reputation Power: 53
When you click the URL and go to the next page, do you see your URL variable in the URL up in the location box? ie.

http://www.mysite.com/page2.cfm?myurlvalue=10

?

If so, then that value should be available in the URL scope on that page. If it is not, then something you are doing is explicitly overwriting the URL scope.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #11  
Old May 23rd, 2005, 11:38 AM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 272 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 8 m 8 sec
Reputation Power: 4
I end up seeing

http://www.blahblahURL.cfm?portID=#form.criteria#

Reply With Quote
  #12  
Old May 23rd, 2005, 11:47 AM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 272 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 8 m 8 sec
Reputation Power: 4
and by the way, i'm not moving a number, i'm moving a string

Reply With Quote
  #13  
Old May 23rd, 2005, 11:49 AM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 272 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 8 m 8 sec
Reputation Power: 4
and when I do this...

<cfquery datasource="numberonerule" name="subjectindex">
select Name, quote, topic
from quote
where topic=#URL.PortID#
</cfquery>

I get a syntax error near the equal sign in the where statment...

so, I figure it wants me to change it too '#url.portid#' which doesn't work either

Reply With Quote
  #14  
Old May 23rd, 2005, 11:55 AM
hanleyk1's Avatar
hanleyk1 hanleyk1 is offline
recovering whitewater addict
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Lexington, you guess the state
Posts: 255 hanleyk1 User rank is Corporal (100 - 500 Reputation Level)hanleyk1 User rank is Corporal (100 - 500 Reputation Level)hanleyk1 User rank is Corporal (100 - 500 Reputation Level)hanleyk1 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 3 Days 19 h 10 m 51 sec
Reputation Power: 8
Although it's been a while and I don't have access to my source code from this location, I have had this problem before.

I don't see any cfoutput tags in your code, so I will just have to assume you are using them correctly.

I think the reason you are getting the text "#form.criteria#" instead of the value of the variable criteria is that you are assigning that value as a string to the new variable criteria in the following string

Code:
<cfset criteria="#form.criteria#">


Try

Code:
<cfoutput><cfset criteria=#form.criteria#></cfoutput>

and see what happens.

Reply With Quote
  #15  
Old May 23rd, 2005, 12:04 PM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 272 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 8 m 8 sec
Reputation Power: 4
Although I don't think the problem is there, I tried it and didn't work...

I know the form.criteria is being passed into the page properly because my verity searches work...and the cfdump shows form.critiera being whatever I sent from the search box in the previous page...I think it's got to have something to do with sending a string across, dunno..maybe i'll try it with a number to test it out

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Strange Behavior Passing Varaibles...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump