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 October 19th, 2005, 01:05 PM
cootjealweer1 cootjealweer1 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Posts: 28 cootjealweer1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 38 m 59 sec
Reputation Power: 0
pass form value to next page with cflocation method?

Hi guys,

I have one page with an insert record behaviour, on that page there's a form value i want to pas to the next page.

the first page is redirecting with cflocation....

Can anyone give me an example of working with parameters or another method zo that i can get the form value from the first page to the next....

Reply With Quote
  #2  
Old October 21st, 2005, 08:28 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
Last time I tried you can not push a value with CFlocation the same way you can with just a regular link.

From the sound of it you're trying to do this.


<a href="gotonextpage.cfm?url=#var1#">

you can't do that in a...

<cflocation url="enterurlhere">

because it will treat whatever is in the URL as the exact url...so if you do

<cflocation url="gotonextpage.cfm?url=#var1#">

it will tell you that

gotonextpage.cfm?url=#var1#

page does not exsist, because it is looking for a file named exactly that.

Reply With Quote
  #3  
Old October 22nd, 2005, 03:25 PM
DOMINATION DOMINATION is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Location: NJ
Posts: 5 DOMINATION User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 12 m 53 sec
Reputation Power: 0
Send a message via MSN to DOMINATION
The thing thats bad about cflocation is that you have to submit a value over a URL. By resubmitting another form, you are able to keep the value out of the URL. By the way, yes you can pass variables which need to be parsed through cflocation.

Code using cflocation BUT showing variable in URL:
Code:
<cfset email = "test@test.com">
<cfset pw = "testpassword">
<cflocation url="http://halo.tcln.com?variable=#email#&pw=#pw#" addtoken="no">
Then the value would be called on the next page by #URL.email# and #URL.pw#



Code resending info without using the URL:
Code:
<form action="index.cfm" method="post" name="theForm" id="theForm">
<input type="hidden" name="email" value="<cfoutput>#FORM.email#</cfoutput>">
<input type="hidden" name="pw" value="<cfoutput>#FORM.pw#</cfoutput>">
</form>

<script>
document.theForm.submit();
</script>
This will resubmit the info via a form and nothing will be passed through the URL. Info can be called on the next page with #FORM.email# and #FORM.pw#

Remember when you use <script>, the code is Case Sensitive. Notice the forms name is "theForm". Notice "theForm" in the <script> is also the same Case.

Enjoy,
Wes

Reply With Quote
  #4  
Old October 23rd, 2005, 08:05 AM
cootjealweer1 cootjealweer1 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Posts: 28 cootjealweer1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 38 m 59 sec
Reputation Power: 0
hi guys, thanx for your help and sorry for my late response, this is very usable!!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > pass form value to next page with cflocation method?


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


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway