How to get an alert/confirm dialog box with custom message when refreshing a page - reactjs

I am trying to show a pop-up (alert/confirm box) with a custom message when a user refreshes a page. The reason is to alert the user that the data they entered might be lost. I have tried working with the 'beforeunload' event -> https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload.
It shows a dialog box specific to the browser and the message cannot be modified anymore. Is there a way to show our prompt (alert/confirm) with custom message? If there is, will it cause any security issues?

Related

How to prevent going back without refreshing the current page onpopstate event with a confirmation alert?

Does anyone know how to show a confirmation alert to user on go back or go forward buttons of browser clicked?
I tried to use popstate event but it does not show an alert to user. Then I added an confitmation alert on popstate event but even if the user cancel the alert it goes back. I found I can use history.forward() inside on cancel event but what it does is just refreshing the page but I do not want to refresh the page because I don’t want to lose any information. Please help.

How to prevent reload and show custom popup?

I have a form, when my user tries to reload, I need to show the popup "If you reload the page you cannot use this form".
the page is reloaded using a button in browsers
How to prevent reload and show custom popup ?
The browsers are designed to ask for confirmation with the native popup https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event
And this cannot be customized (which would require async handling)
If the latter was possible people would get stuck on porn pages and would never have the chance to leave them.

How to continue old conversation in Cortana after user clicks on a card that invokes a URL?

As you can see from the below screenshot, we are able to create a Cortana channel based MS Chatbot that lists out certain information.
When we click on the card, we are getting navigated to the URL's as well but there are additional dialogues post this action. Cortana for some reason doesnt retain this information and we have to start all over again, as it loses its focus. Can someone suggest how to get Cortana to be at the same point where we invoked the URL click action?

How to show loading image when to send an email in wpf application

Basically I send an email by clicking on send button. While clicking on send button, I want to show a loading image and it (the image) should automatically hide after the email was sent.
There is an article about here. I think it works for you. Just change visibility of progress bar according to sending mail and its completion.

Hide button on PDF before flattening in LiveCycle Workbench

ASP.NET application asks user to fill in fields.
User clicks a "Request Signatures" button in the application and a LiveCycle service is called to create the pdf.
The pdf is saved in the ASP.NET application database.
This pdf has to then be digitally signed by 3 people.
A link to the pdf is shown to the first person in the workflow.
User clicks on link and the pdf is shown in the browser for them to digitally sign.
At the bottom of the pdf is a submit button, which the user clicks after signing.
The pdf is submitted to a web page which updates the pdf in the database and through other database tables, is put in the next person's "to-do" list.
2nd & 3rd person repeat #5 - #8
After the 3rd person signs, the pdf is considered complete. The pdf is to be flattened using LiveCycles Output service transformPDF
The problem is the "Submit" button on the form. I have made it "Visible - Screen only" to take care of anyone that wants to print a hard copy anytime during the process. However, I have a feeling the client will complain that the Submit button shows up on screen. Also, the final, flattened pdf should not show the button as it's being submitted to an official repository for these forms in which other forms don't have a submit button.
After the 3rd person signs, I can easily set the submit button presence to hidden. Then when it's flattened, it won't show up. The problem comes when the user wants a "Print View" before or during the signing process.
So my question is can I make a LiveCycle process that takes in a document variable (the pdf with the submit button) and output a document variable (the pdf without the submit button). Meaning the process would have to somehow run javascript inside the pdf to hide the submit button.
That event could be the prePrint event to remove the button from the layout.
And you will need postPrint event to put the button back in.
on the prePrint event of the button(to hide the button):
this.presence = "hidden";
on the postPrint event of the button(to show the button):
this.presence = "visible";

Resources