Search code examples
coldfusionhttp-status-code-303

More on 303 redirect


Yesterday, Peter Boughton mentioned that a 303 redirect can be used to transform to a refresh-friendly GET request.

Q: How is this done? Suppose I have the form:

<form method="post">
<button type="submit" name="Save">Save</button>
</form>

Then how do you do a 303 redirect to keep the user from submitting the same thing by pressing F5?

Note: As of bootstrap 3, I'm now using button type=submit in favor of input type=submit.


Solution

  • You can use

    <cflocation url = "newpage.cfm" addToken = "no" statusCode = "303">
    

    See https://learn.adobe.com/wiki/display/coldfusionen/cflocation for more details