2 Replies Latest reply on Feb 20, 2009 7:59 AM by John Hall

    Confirmation Dialog Box

    John Hall Level 4
      I use Alert controls for several things so I feel comfortable doing the basics, but I'm a bit stumped on the best approach for the following scenario. I have several Cancel buttons in my application. If the user is in the middle of editing a form and they want to cancel, I want to confirm that they are willing to lose their changes. I don't want to have a separate script for each one so I'm trying to think of the path to take to have the following happen.

      Click on the cancel button. That dispatches the click event and passes parameters of two custom events which I want to occur if the user says continue.

      I can certainly get the events into the first function that displays the Alert box but I'm not sure of the best approach to fire off the custom events if they say "yes" since it seems it would require passing parameters along with the CloseEvent to the callback.

      Any suggestions on general approach to this?
        • 1. Re: Confirmation Dialog Box
          Level 7

          "John Hall" <webforumsuser@macromedia.com> wrote in message
          news:gnl5cr$ln4$1@forums.macromedia.com...
          >I use Alert controls for several things so I feel comfortable doing the
          >basics,
          > but I'm a bit stumped on the best approach for the following scenario. I
          > have
          > several Cancel buttons in my application. If the user is in the middle of
          > editing a form and they want to cancel, I want to confirm that they are
          > willing
          > to lose their changes. I don't want to have a separate script for each one
          > so
          > I'm trying to think of the path to take to have the following happen.
          >
          > Click on the cancel button. That dispatches the click event and passes
          > parameters of two custom events which I want to occur if the user says
          > continue.
          >
          > I can certainly get the events into the first function that displays the
          > Alert
          > box but I'm not sure of the best approach to fire off the custom events if
          > they
          > say "yes" since it seems it would require passing parameters along with
          > the
          > CloseEvent to the callback.
          >
          > Any suggestions on general approach to this?

          Why not just create a custom "cancel" component and reuse that where you
          need it?


          • 2. Re: Confirmation Dialog Box
            John Hall Level 4
            I'm almost there. It just shows the old saying, 'great minds and newbies think alike on occasion'