0

I have a form with a table in coldfusion 9 where the user enters part numbers and the form's submit button then executes the same page again. Here we check that submit was pressed and then step through the form's records checking for the part availability.

All works as expected... except if the user refreshes the page before the submit button is pressed... then all existing form records are duplicated in the form.

I am looking for a way to force a form submit, if user refreshes the page before pressing submit

Is this possible?

Heff
  • 1
  • 1
  • You can use `onbeforeunload` javascript event. It won't submit the form, but you can use it to warn the user. See this http://stackoverflow.com/questions/147636/best-way-to-detect-when-a-user-leaves-a-web-page – beloitdavisja Feb 15 '16 at 15:39
  • Another solution might be to convert adding the part numbers as an AJAX request and update the page with the results of the AJAX request without reloading. That way there isn't a form submit if they refresh. – beloitdavisja Feb 15 '16 at 15:41
  • 2
    I would treat this as a self inflicted injury by the user and simply not worry about it. – Dan Bracuk Feb 15 '16 at 16:32

0 Answers0