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

Back button - do not disable

New Here ,
Sep 18, 2008 Sep 18, 2008
I have a form with a predisplayed line item number, in this case 1, to start off. There is a checkbox to add another line item, so if they check the box and fill out the form and submit, it brings up the form again with line item 2 (continuous increment by 1 if the box is checked). If they fill out the form again and do not check the add another line item box, the form submits and goes to another page with a popup message indicating a successful transaction.

Here is the problem. On the message page, if they hit the back button on the browser, it goes back to the form, with line item 2 (which was already submitted). If they submit again, line item 2 will be written to the table again, and there can only be one line item.

If I make the line item a unique key in the table, the application will just blowup. Can it display a nice error message about duplicate line items ?

My other option would be to use javascript to disable the back button, but everyone says that is not recommened.

If that is the case, what do I do to avoid this situation ?

The sequence of events/screens works properly, but as soon as they use the back button, that is where I run into problems.
429
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
LEGEND ,
Sep 18, 2008 Sep 18, 2008
You could always disable caching on the form page.
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
New Here ,
Sep 18, 2008 Sep 18, 2008
If I disable caching on the form page and they hit the back button to go back to the form page, what line item value would be displayed ?

Ideally, if it was 2 and they hit the back button, the next value would be three.

Disabling cache, cookies, and sessions was suggested by coworkers, but nobody could figure out how to get the next value in there.
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
LEGEND ,
Sep 18, 2008 Sep 18, 2008
LATEST
If you disable caching, and they go back to it, it won't come up. They'll have to refresh it in which case they get the page they started with, not the one they submitted.
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