caching - How to prevent form fields from repopulating after clicking the back button? -
i have simple form has 4 fields named firstname, lastname, address , phone number.
after user fills form , clicks submit button, if goes fine, redirecting user success page.
but on clicking browser button success page form field values repopulating on form. how can prevent happening?
i have tried code:
<cfheader name="cache-control" value="no-cache, no-store, must-revalidate"> <cfheader name="pragma" value="no-cache"> <cfheader name="expires" value="#gethttptimestring(now()-1)#">
but not working.
repopulating form fields good thing, stop trying break it.
if want prevent duplicate submissions, send unique id (e.g. uuid) along form , keep track of ones you've received (how many keep track of depends on application).
if receive duplicate can either ignore (and display appropriate message), or go step further: check whether received data has been submitted or whether it's attempt change previous submission (i.e. fixing typo), or create new record (maybe firstname , phone changed), or prompt user choose, or whatever.
Comments
Post a Comment