How can I require the user to confirm a button click?
Posted: Fri May 31, 2013 12:36 pm
When a user clicks a button I want an alert type window (or some type of interaction) to appear requiring the user to confirm that they meant to click the button. Confirming would result in the button's action to continue, canceling would just act like the button was never clicked.
I know I could handle within the program but in this case I need a solution without having to return to the program.
I found there is a javascript function that I see can be used like:
When I try to set either the onclick property of the button or the onsubmit property of the record format with I get an error that
When I try to set the button's onclick property as below nothing happens when I click the button, no alert window, the button's action doesn't occur. I'm not sure if I need to be doing something with that function.
Is there a PUI way of requiring a confirmation for an onclick event that would do what I need?
I know I could handle within the program but in this case I need a solution without having to return to the program.
I found there is a javascript function that I see can be used like:
Code: Select all
onclick="return confirm('Click OK to Close the Page, Click Cancel to Return to the Page');"
Code: Select all
return confirm('Click OK to Close the Page, Click Cancel to Return to the Page')
If I take out the "return" then I get the alert window but clicking OK or Cancel has no impact, nothing happens when the alert window closes.'return' statement outside of function
When I try to set the button's onclick property as below nothing happens when I click the button, no alert window, the button's action doesn't occur.
Code: Select all
js: function confirmClose() {
return confirm('Click OK to Close the Page, Click Cancel to Return to the Page');
}
Is there a PUI way of requiring a confirmation for an onclick event that would do what I need?