How can I create a clickable popup-window in transition?

Hi there,

I'm using SBM 12.1 for a few month now. My customer asked me to show in a transition form a button(like cancel and delete). If this button would be clicked, a popup should appear, with a text like "do you really want to cancel, all fields are deleted". In this popup there should be to new clickable buttons "yes, cancel an delete", "no, don't delete". I know, how to create popups in composer, but not creating clickable buttons within these popups?

I'm not so good in javascript or html, are there any possibilities in composer to do so?

Thanks.

  • 0  

    Without JavaScript knowledge that will be tough. You could search online about creating dialogs with jQuery and try to leverage that as SBM includes jQuery by default.

    You could use the confirm dialog as a workaround, but the default buttons are "Yes" and "Cancel", which means changing your question around. 

    You would  create a form action that is triggered on button click, then in the IF choose "execute Javascript" and enter:
    confirm("Do you really want to delete date in fields? ")

    For the Then, do the action that clears the fields.

    For the custom dialog, it's a bit more complicated.

  • Suggested Answer

    0

    You could try adding a form action with a "confirm" call.

    Add a Button to your form.  In this example the button is called "btn_Kablooie".  Then add an Action to the form like the one in the pic below.  The Javascript in the action will be like this:

    window.confirm("Do you really want to exit the current operation and delete all data?\r\nSelect 'OK' to abort and delete.\r\nSelect 'Cancel' to not delete")

    Because the text of the popup "OK" and "Cancel" buttons can't be customized, you may have to modify your syntax or the message so that the word "Cancel" really means "NO!!!  Don't cancel the form -- don't delete my data!!!".

    When you click the button on the form here's what you see.  NOTE: This is Composer's "browser" preview: