Message box with Javascript

Message box with Javascript

Can anyone show me how to do a simple confirmation message box with Javascript?

Are you sure you want to overwrite this record?
                        Yes     No
Hi Gerry,

Before anything, note that in OutSystems, links and buttons have a property (in the On Click section) called Confirmation Message that will likely do what you're trying to... you should really give it a try.

But if for some reason that doesn't work for you, the (second) simplest way to have a confirmation box done in JavaScript is by using the browser's native confirm function. This is the easiest way because it requires a tiny amount of code and the script execution (and page interaction) is halted until the user selects either OK or Cancel and the function returns with the confirmation result.

Since you won't be able to customize the buttons, in your particular case you'd have to rephrase the question from something such as "Are you sure you want to overwrite this record? (Yes/No)" into "The record will be overwritten. (OK/Cancel)".


Thanks. I know about the confirmation message, but this message needs to be popped up downstream. Does anyone have an example of how to use the javascript popup in Outsystems?
I think I may not be getting your idea... Could you elaborate on what you mean by popped up downstream?
Say you press a button, but you need to run some logic to check something and based on your findings you may want to pop up a question? That's why I wanted to know how to implement the javascript pop up/confim .
Hi Gerry,

You can use an hidden button to do that. If you need to pop up the question, simple make widget click on that button that have the confirmation message.