Connecting Tech Pros Worldwide Help | Site Map

How To Create Sticky Forms

 
LinkBack Thread Tools Search this Thread
  #1  
Old June 27th, 2008, 12:46 PM
Newbie
 
Join Date: Mar 2008
Posts: 2
Default How To Create Sticky Forms

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!
Reply
  #2  
Old June 27th, 2008, 02:04 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,257
Default

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.
Reply
  #3  
Old August 15th, 2008, 01:46 PM
Newbie
 
Join Date: Mar 2008
Posts: 2
Default

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!
Reply
  #4  
Old August 15th, 2008, 02:07 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,257
Default

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

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.