Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8980267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:02:37+00:00 2026-06-15T20:02:37+00:00

I am creating an exam application mainly using php and jquery. At the moment

  • 0

I am creating an exam application mainly using php and jquery. At the moment the application has these pages in order to for the user to create an exam:

  • Create.php (teacher creates the exam details e.g. date, time, duration,
    subject, number of questions, total marks etc)
  • QandA.php (teacher creates questions and answers for the exam)
  • Marks.php (teacher sets up marks for each correct answer(s) per question)
  • Penalty.php (teacher selects whether their exam will contain penalty marks or not)
  • Finish.php (simply states that your creation of your exam is complete)

Now the application works fine but there is something I have realized. As this application is run on a browser, the user is able to at anytime click on the Browser back button. This is going to cause big problems because if I am half way in completing the creation of the exam but click on the browser back button, then I will lose my exam creation progress or worse I am able to do one of the pages again. This could mean the database which stores the details will contain a half complete exam or an exam which could contain more information than required.

So this is what I am thinking of doing but I do not know if first of all if it is possible and if it is best practice to do so:

  • If user clicks on a back browser button while on any of the 4 pages above (except for finish.php) then a confirmation box appears stating “if you go back to previous page then you will lose all your current progress and be sent to menu page (menu.php)

  • If user clicks on OK in the confirmation box, then it will navigate user to the menu.php page and it will also by AJAX navigate to another php page (deleteentry.php) where it will delete the exam details from the database)

  • If user clicks on Cancel then they can continue on current page no problem

  • If user clicks on back browser button while on finish.php page, then it will display an alert stating “you can’t go back, your exax has been sucessfully completed, you will be navigated back to menu page” And all it will do is navigate user to menu.php page and thats it, no ajax to call or anything)

My question then is that

  1. Is the above ideas a suitable solution to be able to tackle this problem

  2. How should the code can be written to determine when the back browser button has been pressed depending on the page it was pressed on and be able to perform the commands it is able to perform? Also need to know how the AJAX can be written to navigate to deleteentry.php page in background.

Thank You very much

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T20:02:39+00:00Added an answer on June 15, 2026 at 8:02 pm

    I am going to answer the question in your title:

    How to display alert and confirmation if back browser button has been clicked

    You can’t know if the “back” button was clicked or if the page was refreshed or just page changed ->

    The onunload event will handle all of those cases.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an exam application where for the user to create an exam they
im creating a method where a user input has to type A/B to get
Creating My Windows Form Application and using ADO.Net as Data Access layer and SQL
I am creating an online exam page for my project. I have a countdown
In MS Exam 70-536 .Net Foundation , Chapter 7 Threading in Lesson 1 Creating
Creating a google map with store locations within 50 miles of user entered address.
Creating a simple RPG game, first time using XNA. Trying to get my character
Good day! I am a newbie on creating database... I need to create a
Creating an application that requires BOTH gesture(swipe) support as well as simple touch events.
Creating simple php login scripts is easy, with simple one table mysql integration. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.