Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to display message on Server Side if I click on browser button
    text
    copied!<p>I want the below question to work for all major browser Opera, Internet Explorer, Chrome, Safari and Firefox</p> <p>I want to create an application where the user has to follow an order of pages <code>Text1.php, Text2.php, Text3.php</code> in order to fully able to create an exam.</p> <p>Problem is that at anytime the user can click on the <code>back</code> or <code>forward</code> browser buttons or access another page by entering in the page url.</p> <p>So my question is this:</p> <ol> <li><p>If user clicks on <code>back</code> or <code>forward</code> browser buttons, it will display a prompt box or little window stating that:</p> <blockquote> <p>You are not suppose to leave this page when creating an assessment, if you want to leave the page then you will sent back to the "Menu" page and lose all you details for this exam. Click on this link below:</p> <p>Leave Assessment</p> <p>If you want to contine with creating the current assessment then please click on the link below:</p> <p>Continue Assessment</p> </blockquote></li> <li><p>If user is on either of Assessment creating pages <code>Text1.php, Text2.php OR Text3.php</code> and the user tries to change web address in url to access another page then the same window or prompt box or above will be displayed.</p></li> </ol> <p>My question is that is this possible where if the box is shown when url or browser buttons are used and then be able to stay on current page if user clicks on <code>Continue Assessment</code> or navigate to <code>menu.php</code> if user clicks on <code>Leave Assessment</code> link. Can somebody provide a sample on how this can be achieved? I need it working in all the major browsers.</p> <p>Thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload