Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Clear Form Fields

Guest
Jan 20, 2009 Jan 20, 2009
Hello,

Does Coldfusion have a way of clearing out form fields after a submission and retrun the user to an empty form? Here is a portion of my code.
1.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jan 21, 2009 Jan 21, 2009
There are at least three ways (cflocation, js window.location, and meta refresh) to take the user back to your form page after you process your data. The form will be empty unless you do something to pre-populate it.
Translate
LEGEND ,
Jan 21, 2009 Jan 21, 2009
There are at least three ways (cflocation, js window.location, and meta refresh) to take the user back to your form page after you process your data. The form will be empty unless you do something to pre-populate it.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 21, 2009 Jan 21, 2009
LATEST
I would use CFLOCATION as the simplest method; just add that tag with the right parameter after your form has been processed on the action page and it will send the user back to the original form page, as Dan said with empty fields unless you're pre-populating in some way.

If you are pre-populating, you could pass a URL variable to the form that tells it NOT to do so if you want.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources