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:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old March 10th, 2004, 08:17 AM
elise_driver elise_driver is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Norwich
Posts: 53 elise_driver User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 27 m 10 sec
Reputation Power: 5
Angry coldfusion navigation problem

hi,

I am performing a search through a form and want to limit the number of items displayed. I have got this working but when the next button is pressed tp display further results I get the following error message:

Element LISTTYPE is undefined in FORM.


On the first page in debugging I have the following elements.

Form Fields:
FIELDNAMES=LISTTYPE,LISTBEDROOM,LISTTOWN,LISTPRICE,SUBMIT
LISTBEDROOM=value
LISTPRICE=value
LISTTOWN=value
LISTTYPE=value
SUBMIT=Property Search

These aren't in debugging when next is pressed so I assume they are not in scope.


How do i pass these form fields using navigation?

I am using a repaet region server behaviour.

Hope you can help.

Thanks

peter

Reply With Quote
  #2  
Old March 10th, 2004, 07:34 PM
kiteless kiteless is offline
Moderator
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,480 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 3 Days 17 h 33 m 17 sec
Reputation Power: 42
You must create hidden form fields to pass the form elements on to another page. You can do this manually, or you can loop over the form.fieldlist list and create the hidden form elements automatically. But when the user presses submit on the second form, if you have not moved your form values into hidden form fields they won't be posted to the next form.

You could also look into storing them in a shared scope such as session or client variables.

Reply With Quote
  #3  
Old March 11th, 2004, 02:25 AM
elise_driver elise_driver is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Norwich
Posts: 53 elise_driver User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 27 m 10 sec
Reputation Power: 5
creating hidden form fields

Thanks for your help.
I'm still very new to coldfusion.
Have you got any sample code i could look at to give me an idea of creating hidden form fields and how to pass the form elements on to another page please?

If I have displayed some of the results on one page and pass over the form elements will the next page display correctly. e.g if page one displays records 1 to 5 will the next page display records 6 to 10 and so on?

I have to congratulate you on running the best forum that I have found and I have looked at very many.

Cheers

peter

Reply With Quote
  #4  
Old March 11th, 2004, 08:37 AM
kiteless kiteless is offline
Moderator
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,480 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 3 Days 17 h 33 m 17 sec
Reputation Power: 42
You can do it two ways. Manually:

<cfoutput>
<input type="hidden" name="listtype" value="#form.listtype" />
<input type="hidden" name="listbedroom" value="#form.listbedroom#" /> ....etc....
</cfoutput>

Or automatically (you may need to manually omit the submit value depending on what you need to do):

<cfloop index="thisField" list="#form.fieldnames#" delimiters=",">
<input type="hidden" name="#thisField#" value="#form.fieldnames[thisField]#" />
</cfloop>

Reply With Quote
  #5  
Old March 15th, 2004, 03:14 AM
elise_driver elise_driver is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Norwich
Posts: 53 elise_driver User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 27 m 10 sec
Reputation Power: 5
Hi,

I wasn't exactly sure where to insert the code so tried it in the search form. When I refreshed the page I got the following error message:

ColdFusion was looking at the following text:
\"

The CFML compiler was processing:

An expression that began on line 132, column 45.
Your expression might be missing an ending "#" (it might look like #expr ).
The body of a cfoutput tag beginning on line 131, column 21.


The error occurred in C:\CFusionMX\wwwroot\Bernada Test Site PETE\Templates\NoTemplate.cfm: line 132

130 :
131 : <cfoutput>
132 : <input type="hidden" name="listtype" value="#form.listtype" />
133 : <input type="hidden" name="listbedroom" value="#form.listbedroom#" />
134 : </cfoutput>



This is the code for the entire form.



<table>


<tr><form action="ResultsNavigation.cfm" method="post" name="frmSearch">


<td align="right" valign="centre">
<select name="ListType">
<option value="value">Type of property</option>
<cfoutput query="q_saletype">
<option value="#q_saletype.sale_type#">#q_saletype.sale_type#</option>
</cfoutput>
</select>
<select name="ListBedroom" id="select">
<option value="value">Bedrooms</option>
<cfoutput query="q_bedroom">
<option value="#q_bedroom.room_bedroom#">#q_bedroom.room_bedroom#</option>
</cfoutput>
</select>
<select name="ListTown">
<option value="value">Location</option>
<cfoutput query="q_town">
<option value="#q_town.townname#">#q_town.townname#</option>
</cfoutput>
</select>

<select name="ListPrice">
<option value="value">Price range</option>
<cfoutput query="q_price">
<option value="#q_price.price#">#q_price.price#</option>
</cfoutput>
</select>


This is probably in the wrong place?: Should it be on thius page or the results page of the form action e.g ResultsNavigation.cfm


<cfoutput>
<input type="hidden" name="listtype" value="#form.listtype" />
<input type="hidden" name="listbedroom" value="#form.listbedroom#" />
</cfoutput>


<input type="submit" name="Submit" value="Property Search"></td></form> </tr>



</tr>
</table>


Hopefully will get this working with a little bit more assistance.

Thanks for your help.

Cheers

Peter

Reply With Quote
  #6  
Old March 15th, 2004, 05:32 AM
elise_driver elise_driver is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Norwich
Posts: 53 elise_driver User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 27 m 10 sec
Reputation Power: 5
I have also tried the cfloop code but still get error message of:

element fieldnames is undefined.


<cfloop index="thisField" list="#form.fieldnames#" delimiters=",">
<input type="hidden" name="#thisField#" value="#form.fieldnames[thisField]#" />
</cfloop>

The missing # at the end of '#form.ListType' wasn't the problem with the manual solution.

Cheers

Peter

Reply With Quote
  #7  
Old March 15th, 2004, 12:08 PM
kiteless kiteless is offline
Moderator
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,480 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 3 Days 17 h 33 m 17 sec
Reputation Power: 42
form.fieldnames will only be available on a TARGET page, a page to which you have POSTED a form. So that is where you want to put the code. If form.fieldnames is not defined then you are referencing that variable on a page that has not had a form posted to it. Try wrapping the code in a check to confirm that form.fieldnames is defined:

<cfif isDefined( 'form.fieldnames' )>
...manual or loop code to carry over the posted form fields goes here...
</cfif>

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > coldfusion navigation problem


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

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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





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