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:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old June 9th, 2004, 10:41 AM
aashton aashton is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 30 aashton User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Dynamic form content in ColdFusion

I have an HTML form in a ColdFusion page. The form uses the
method=POST to send information to a database upon submission. Is
there any way to have ColdFusion display certain elements of the form
based on previous selections (but before the form is submitted).

For example, the form collects the standard info -- name, email,
phone, and then asks to select one from a set of radio buttons, with
options like 'Book', 'Magazine', 'CD', 'DVD'. What I would like to
do, is have different parts of the form appear (or maybe just
enabled) depending on which radio button you pick. So, if you
choose 'Book', the form will expand to include fields you need to
enter such as 'Author', 'ISBN', etc. And if you choose 'CD', you'll
then be asked to enter 'Composer/Band', 'CD Title', etc. And so on.
I realize that I could do this with a series of forms, so that you
select 'Book', submit that and then get sent to a different form, but
for various reasons I would like it all encapsulated in one
ColdFusion document.

The problem, of course, is that until the form is submitted I can't
figure out how ColdFusion know what you've selected. Is there some
onClick technique I can use or something? I realize that I could do this with DHTML, but I'd rather not deal with the issues involved...Thanks!

Reply With Quote
  #2  
Old June 9th, 2004, 12:29 PM
kiteless kiteless is offline
Moderator
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,488 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 18 h 10 m 11 sec
Reputation Power: 42
The only way to do this (without making a request to the server as you mentioned) is to use Javascript and DHTML to enable or make visible the appropriate parts of the form. CF only works on the server side and has no control over the client-side browser behavior aside from it's ability to generate dynamic Javascript to send the user along with the page.

You might look at the QForms Javascript API which does a number of these sorts of things and plays quite nicely with CF. http://www.pengoworks.com

This could also be done with Flash of course.
__________________
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
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Dynamic form content in ColdFusion


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 6 hosted by Hostway