![]() |
|||
|
|||
ColdFusion Mad Libs (Part 1 Of 2)
Hello ColdFusion people. Here's a nice little time-waster that you can put up on your site that is sure to amuse your visitors and keep them coming back for more.
For those that may not be aware, Mad Libs were very popular in the late 70's and early 80's (yes, I *am* that old). A Mad Lib is a story with certain words omitted. The type of word is specified (eg noun, verb, adjective, etc). One person asks another person (or group of people) to provide those words, and proceeds to fill in the blanks. The result is often amusing (and more often than not, kind of dirty).
If you want to see this in action, check out http://charlie.griefer.com/madlibs_1.cfm.
At it's most basic, this is a very easy application to create. It requires only two templates…a form (to collect the missing words), and the form's action page (to display the completed story).
On with the show. This very simple example is going to use the nursery rhyme Jack & Jill to create our Mad Lib:
madlibs_1.cfm:
You'll see that this is a simple form, asking for only 7 values. It includes a simple JavaScript form field validation, which is pretty important. If any fields are left blank, the effect on the next page will not be the effect desired. Although it's very basic, it does the job. It executes when the form is submitted (see inside the
BLOG TALK 
Become a WebProNews blog partner.
Twitter Uncomfortable With 'Tweet' Being Used In Third Party AppsLooks like Twitter is not looking the other way as much these days. TechCrunch reports that there is some concern at the ...
Flickr Just Now Allowing Connectivity With Twitter
Hulu Receives Good News Concerning Their Online Ad Format
Global Gaming Factory Buys Up Pirate Bay


