Skip to main content
January 21, 2009
Answered

Clear Form Fields

  • January 21, 2009
  • 2 replies
  • 1587 views
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.
    This topic has been closed for replies.
    Correct answer Dan_Bracuk
    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.

    2 replies

    Participating Frequently
    January 22, 2009
    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.
    Dan_BracukCorrect answer
    Inspiring
    January 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.