|
|
|
Re: Dynamic action 'Confirm' problem [message #535293 is a reply to message #535265] |
Tue, 13 December 2011 06:53 |
c_stenersen
Messages: 255 Registered: August 2007
|
Senior Member |
|
|
Ok, I see that now (I was sure that's how I had done it in the past, but obviously I was wrong.)
Try this then: In button action you choose redirect to URL. Then as the target you set:
javascript:if(confirm('My question here?')){
doSubmit('MYBUTTONNAME');
}
(Replace MYBUTTONNAME with the name you've given your button, and all the conditions you have added based on it will be interpreted correctly.)
|
|
|
|
Re: Dynamic action 'Confirm' problem [message #535299 is a reply to message #535298] |
Tue, 13 December 2011 07:08 |
c_stenersen
Messages: 255 Registered: August 2007
|
Senior Member |
|
|
Just for future reference, it's also possible to do it with dynamic actions if you want to.
Then you add a dynamic action for the button, set as a condition type "javascript expression", the expression is this.browserEvent != 'load' && confirm('My question?') (if I didn't add the browser event condition I got the popup also when the page loaded strangely enough, even if the dynamic action wasn't set to fire on page load.)
The action is "submit page", and you add the button name in the "request/button name" field.
|
|
|
|
Re: Dynamic action 'Confirm' problem [message #535315 is a reply to message #535313] |
Tue, 13 December 2011 08:41 |
c_stenersen
Messages: 255 Registered: August 2007
|
Senior Member |
|
|
I guess the advantage would be that with a dynamic action it's easier for a person who might maintain this thing apart from you (or even for yourself in case you forget) to see that there's something being triggered on click other than just submitting the page. But apart from that the functionality is the same so it shouldn't matter.
|
|
|
|