Connecting Tech Pros Worldwide Help | Site Map

How To Create Sticky Forms

Newbie
 
Join Date: Mar 2008
Posts: 2
#1: Jun 27 '08
Hey Guys,

I have just started working on ColdFusion, so I am relatively new to it than most of you may be. I am trying to create 'Sticky Stay-Filled' forms so that when the form is submitted, the details entered on the form show up on the page following the submit. Just FYI, the form is submitted to itself. I have done this in PHP almost a hundred times but have never done it in CF.

Here's a link to what I am looking for:
http://www.webdeveloperny.com/form.php

Any help is really appreciated!

Thanks!
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#2: Jun 27 '08

re: How To Create Sticky Forms


What you need to do is take the inputs from the form, e.g. if POSTed, form.field, otherwise url.field (for GET), then for text input fields, set the value using Coldfusion to output it, e.g.
Expand|Select|Wrap|Line Numbers
  1. <input type="text" name="field" value="<cfoutput>#form.field#</cfoutput>">
For select elements, set the selected option if the values match. For radio/checkboxes, set the checked property for matching values.
Newbie
 
Join Date: Mar 2008
Posts: 2
#3: Aug 15 '08

re: How To Create Sticky Forms


Quote:

Originally Posted by acoder

What you need to do is take the inputs from the form, e.g. if POSTed, form.field, otherwise url.field (for GET), then for text input fields, set the value using Coldfusion to output it, e.g.

Expand|Select|Wrap|Line Numbers
  1. <input type="text" name="field" value="<cfoutput>#form.field#</cfoutput>">
For select elements, set the selected option if the values match. For radio/checkboxes, set the checked property for matching values.


Thanks for your reply, saved me some time googling for an answer!
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#4: Aug 15 '08

re: How To Create Sticky Forms


You're welcome. Glad it helped even if after some time ;)
Reply