Loading ...
Sorry, an error occurred while loading the content.

[ydn-javascript] Submit button with SimpleDialog as alert

Expand Messages
  • Marcel Overdijk
    I m creating a submit button on my page as below:
    Message 1 of 14 , Jan 16, 2009
    • 0 Attachment
      I'm creating a submit button on my page as below:



      <input type="submit" name="_action_Delete"
      value="Delete" />


      <script type="text/javascript">
      YAHOO.util.Event.onDOMReady(function () {
      new YAHOO.widget.Button("delete");
      });
      </script>

      The page/form contains additional button (e.g. edit) so the name/value of
      the button clicked is important.
      In my backend I use this to determine which button was clicked and execute
      some action.

      Now before submitting a delete request I want the end-user to show a alert
      using a simpleDialog.
      Before using Yui I used a simple alert which worked fine.

      I'm using this:

      // Define various event handlers for Dialog
      var handleYes = function() {
      alert("You clicked yes!");
      this.hide();
      };
      var handleNo = function() {
      this.hide();
      };

      // Instantiate the Dialog
      var simpledialog1 = new
      YAHOO.widget.SimpleDialog("simpledialog1",
      { width: "300px",
      fixedcenter: true,
      visible: false,
      draggable: false,
      close: true,
      text: "Do you want to continue?",
      icon:
      YAHOO.widget.SimpleDialog.ICON_HELP,
      constraintoviewport: true,
      modal: true,
      buttons: [ { text:"Yes",
      handler:handleYes, isDefault:true },
      { text:"No", handler:handleNo
      } ]
      } );
      simpledialog1.setHeader("Are you sure?");
      simpledialog1.render("container");

      YAHOO.util.Event.addListener("show", "click",
      simpledialog1.show, simpledialog1, true);

      But I'm missing the final piece....

      How can hook up the dialog to the delete button click, and the when pressing
      yes send the submit?
      --
      View this message in context: http://www.nabble.com/Submit-button-with-SimpleDialog-as-alert-tp21507820p21507820.html
      Sent from the ydn-javascript mailing list archive at Nabble.com.
    • Marcel Overdijk
      I m wondering if somebody has an idea. I think this is very standard use case. ... -- View this message in context:
      Message 2 of 14 , Jan 19, 2009
      • 0 Attachment
        I'm wondering if somebody has an idea. I think this is very standard use
        case.



        Marcel Overdijk wrote:
        >
        > I'm creating a submit button on my page as below:
        >
        >
        >
        > <input type="submit" name="_action_Delete"
        > value="Delete" />
        >
        >
        > <script type="text/javascript">
        > YAHOO.util.Event.onDOMReady(function () {
        > new YAHOO.widget.Button("delete");
        > });
        > </script>
        >
        > The page/form contains additional button (e.g. edit) so the name/value of
        > the button clicked is important.
        > In my backend I use this to determine which button was clicked and execute
        > some action.
        >
        > Now before submitting a delete request I want the end-user to show a alert
        > using a simpleDialog.
        > Before using Yui I used a simple alert which worked fine.
        >
        > I'm using this:
        >
        > // Define various event handlers for Dialog
        > var handleYes = function() {
        > alert("You clicked yes!");
        > this.hide();
        > };
        > var handleNo = function() {
        > this.hide();
        > };
        >
        > // Instantiate the Dialog
        > var simpledialog1 = new
        > YAHOO.widget.SimpleDialog("simpledialog1",
        > { width: "300px",
        > fixedcenter: true,
        > visible: false,
        > draggable: false,
        > close: true,
        > text: "Do you want to continue?",
        > icon:
        > YAHOO.widget.SimpleDialog.ICON_HELP,
        > constraintoviewport: true,
        > modal: true,
        > buttons: [ { text:"Yes",
        > handler:handleYes, isDefault:true },
        > { text:"No",
        > handler:handleNo } ]
        > } );
        > simpledialog1.setHeader("Are you sure?");
        > simpledialog1.render("container");
        >
        > YAHOO.util.Event.addListener("show", "click",
        > simpledialog1.show, simpledialog1, true);
        >
        > But I'm missing the final piece....
        >
        > How can hook up the dialog to the delete button click, and the when
        > pressing yes send the submit?
        >

        --
        View this message in context: http://www.nabble.com/Submit-button-with-SimpleDialog-as-alert-tp21507820p21543247.html
        Sent from the ydn-javascript mailing list archive at Nabble.com.
      • lou_tribal
        If you look at this example you will find everything you need: http://developer.yahoo.com/yui/examples/container/simpledialog-quickstart.html <
        Message 3 of 14 , Jan 19, 2009
        • 0 Attachment
          If you look at this example you will find everything you need:

          http://developer.yahoo.com/yui/examples/container/simpledialog-quickstart.html

          <

          <script type="text/javascri pt">
          YAHOO.util.Event. onDOMReady( function () {
          new YAHOO.widget. Button("delete", {onclick:{fn:myClickFunction,
          obj:}} );
          });
          </script>

          --- In ydn-javascript@yahoogroups.com, Marcel Overdijk
          <marceloverdijk@...> wrote:
          >
          >
          > I'm wondering if somebody has an idea. I think this is very standard use
          > case.
          >
          >
          >
          > Marcel Overdijk wrote:
          > >
          > > I'm creating a submit button on my page as below:
          > >
          > >
          > >
          > > <input type="submit" name="_action_Delete"
          > > value="Delete" />
          > >
          > >
          > > <script type="text/javascript">
          > > YAHOO.util.Event.onDOMReady(function () {
          > > new YAHOO.widget.Button("delete");
          > > });
          > > </script>
          > >
          > > The page/form contains additional button (e.g. edit) so the
          name/value of
          > > the button clicked is important.
          > > In my backend I use this to determine which button was clicked and
          execute
          > > some action.
          > >
          > > Now before submitting a delete request I want the end-user to show
          a alert
          > > using a simpleDialog.
          > > Before using Yui I used a simple alert which worked fine.
          > >
          > > I'm using this:
          > >
          > > // Define various event handlers for Dialog
          > > var handleYes = function() {
          > > alert("You clicked yes!");
          > > this.hide();
          > > };
          > > var handleNo = function() {
          > > this.hide();
          > > };
          > >
          > > // Instantiate the Dialog
          > > var simpledialog1 = new
          > > YAHOO.widget.SimpleDialog("simpledialog1",
          > > { width: "300px",
          > > fixedcenter: true,
          > > visible: false,
          > > draggable: false,
          > > close: true,
          > > text: "Do you want to continue?",
          > > icon:
          > > YAHOO.widget.SimpleDialog.ICON_HELP,
          > > constraintoviewport: true,
          > > modal: true,
          > > buttons: [ { text:"Yes",
          > > handler:handleYes, isDefault:true },
          > > { text:"No",
          > > handler:handleNo } ]
          > > } );
          > > simpledialog1.setHeader("Are you sure?");
          > > simpledialog1.render("container");
          > >
          > > YAHOO.util.Event.addListener("show", "click",
          > > simpledialog1.show, simpledialog1, true);
          > >
          > > But I'm missing the final piece....
          > >
          > > How can hook up the dialog to the delete button click, and the when
          > > pressing yes send the submit?
          > >
          >
          > --
          > View this message in context:
          http://www.nabble.com/Submit-button-with-SimpleDialog-as-alert-tp21507820p21543247.html
          > Sent from the ydn-javascript mailing list archive at Nabble.com.
          >
        • Marcel Overdijk
          Hi, I understand how I can call a handler using onClick. But how can I then submit that button when the user clicked yes. As obj I could pass though the button
          Message 4 of 14 , Jan 19, 2009
          • 0 Attachment
            Hi,

            I understand how I can call a handler using onClick.
            But how can I then submit that button when the user clicked yes.

            As obj I could pass though the button object I guess, but then how to submit
            it?

            Note that my form has 2 submit buttons. One with value Edit and one with
            value Delete.
            So when submitting the form I have to know which button was pressed...


            Cheers,
            Marcel



            lou_tribal wrote:
            >
            > If you look at this example you will find everything you need:
            >
            > http://developer.yahoo.com/yui/examples/container/simpledialog-quickstart.html
            >
            > <
            >
            > <script type="text/javascri pt">
            > YAHOO.util.Event. onDOMReady( function () {
            > new YAHOO.widget. Button("delete", {onclick:{fn:myClickFunction,
            > obj:}} );
            > });
            > </script>
            >
            > --- In ydn-javascript@yahoogroups.com, Marcel Overdijk
            > <marceloverdijk@...> wrote:
            >>
            >>
            >> I'm wondering if somebody has an idea. I think this is very standard use
            >> case.
            >>
            >>
            >>
            >> Marcel Overdijk wrote:
            >> >
            >> > I'm creating a submit button on my page as below:
            >> >
            >> >
            >> >
            >> > <input type="submit" name="_action_Delete"
            >> > value="Delete" />
            >> >
            >> >
            >> > <script type="text/javascript">
            >> > YAHOO.util.Event.onDOMReady(function () {
            >> > new YAHOO.widget.Button("delete");
            >> > });
            >> > </script>
            >> >
            >> > The page/form contains additional button (e.g. edit) so the
            > name/value of
            >> > the button clicked is important.
            >> > In my backend I use this to determine which button was clicked and
            > execute
            >> > some action.
            >> >
            >> > Now before submitting a delete request I want the end-user to show
            > a alert
            >> > using a simpleDialog.
            >> > Before using Yui I used a simple alert which worked fine.
            >> >
            >> > I'm using this:
            >> >
            >> > // Define various event handlers for Dialog
            >> > var handleYes = function() {
            >> > alert("You clicked yes!");
            >> > this.hide();
            >> > };
            >> > var handleNo = function() {
            >> > this.hide();
            >> > };
            >> >
            >> > // Instantiate the Dialog
            >> > var simpledialog1 = new
            >> > YAHOO.widget.SimpleDialog("simpledialog1",
            >> > { width: "300px",
            >> > fixedcenter: true,
            >> > visible: false,
            >> > draggable: false,
            >> > close: true,
            >> > text: "Do you want to continue?",
            >> > icon:
            >> > YAHOO.widget.SimpleDialog.ICON_HELP,
            >> > constraintoviewport: true,
            >> > modal: true,
            >> > buttons: [ { text:"Yes",
            >> > handler:handleYes, isDefault:true },
            >> > { text:"No",
            >> > handler:handleNo } ]
            >> > } );
            >> > simpledialog1.setHeader("Are you sure?");
            >> > simpledialog1.render("container");
            >> >
            >> > YAHOO.util.Event.addListener("show", "click",
            >> > simpledialog1.show, simpledialog1, true);
            >> >
            >> > But I'm missing the final piece....
            >> >
            >> > How can hook up the dialog to the delete button click, and the when
            >> > pressing yes send the submit?
            >> >
            >>
            >> --
            >> View this message in context:
            > http://www.nabble.com/Submit-button-with-SimpleDialog-as-alert-tp21507820p21543247.html
            >> Sent from the ydn-javascript mailing list archive at Nabble.com.
            >>
            >
            >
            >
            >

            --
            View this message in context: http://www.nabble.com/Submit-button-with-SimpleDialog-as-alert-tp21507820p21551795.html
            Sent from the ydn-javascript mailing list archive at Nabble.com.
          • Marcel Overdijk
            Any ideas? I m still facing this problem... ... -- View this message in context:
            Message 5 of 14 , Jan 26, 2009
            • 0 Attachment
              Any ideas? I'm still facing this problem...


              Marcel Overdijk wrote:
              >
              > Hi,
              >
              > I understand how I can call a handler using onClick.
              > But how can I then submit that button when the user clicked yes.
              >
              > As obj I could pass though the button object I guess, but then how to
              > submit it?
              >
              > Note that my form has 2 submit buttons. One with value Edit and one with
              > value Delete.
              > So when submitting the form I have to know which button was pressed...
              >
              >
              > Cheers,
              > Marcel
              >
              >
              >
              > lou_tribal wrote:
              >>
              >> If you look at this example you will find everything you need:
              >>
              >> http://developer.yahoo.com/yui/examples/container/simpledialog-quickstart.html
              >>
              >> <
              >>
              >> <script type="text/javascri pt">
              >> YAHOO.util.Event. onDOMReady( function () {
              >> new YAHOO.widget. Button("delete", {onclick:{fn:myClickFunction,
              >> obj:}} );
              >> });
              >> </script>
              >>
              >> --- In ydn-javascript@yahoogroups.com, Marcel Overdijk
              >> <marceloverdijk@...> wrote:
              >>>
              >>>
              >>> I'm wondering if somebody has an idea. I think this is very standard use
              >>> case.
              >>>
              >>>
              >>>
              >>> Marcel Overdijk wrote:
              >>> >
              >>> > I'm creating a submit button on my page as below:
              >>> >
              >>> >
              >>> >
              >>> > <input type="submit" name="_action_Delete"
              >>> > value="Delete" />
              >>> >
              >>> >
              >>> > <script type="text/javascript">
              >>> > YAHOO.util.Event.onDOMReady(function () {
              >>> > new YAHOO.widget.Button("delete");
              >>> > });
              >>> > </script>
              >>> >
              >>> > The page/form contains additional button (e.g. edit) so the
              >> name/value of
              >>> > the button clicked is important.
              >>> > In my backend I use this to determine which button was clicked and
              >> execute
              >>> > some action.
              >>> >
              >>> > Now before submitting a delete request I want the end-user to show
              >> a alert
              >>> > using a simpleDialog.
              >>> > Before using Yui I used a simple alert which worked fine.
              >>> >
              >>> > I'm using this:
              >>> >
              >>> > // Define various event handlers for Dialog
              >>> > var handleYes = function() {
              >>> > alert("You clicked yes!");
              >>> > this.hide();
              >>> > };
              >>> > var handleNo = function() {
              >>> > this.hide();
              >>> > };
              >>> >
              >>> > // Instantiate the Dialog
              >>> > var simpledialog1 = new
              >>> > YAHOO.widget.SimpleDialog("simpledialog1",
              >>> > { width: "300px",
              >>> > fixedcenter: true,
              >>> > visible: false,
              >>> > draggable: false,
              >>> > close: true,
              >>> > text: "Do you want to continue?",
              >>> > icon:
              >>> > YAHOO.widget.SimpleDialog.ICON_HELP,
              >>> > constraintoviewport: true,
              >>> > modal: true,
              >>> > buttons: [ { text:"Yes",
              >>> > handler:handleYes, isDefault:true },
              >>> > { text:"No",
              >>> > handler:handleNo } ]
              >>> > } );
              >>> > simpledialog1.setHeader("Are you sure?");
              >>> > simpledialog1.render("container");
              >>> >
              >>> > YAHOO.util.Event.addListener("show", "click",
              >>> > simpledialog1.show, simpledialog1, true);
              >>> >
              >>> > But I'm missing the final piece....
              >>> >
              >>> > How can hook up the dialog to the delete button click, and the when
              >>> > pressing yes send the submit?
              >>> >
              >>>
              >>> --
              >>> View this message in context:
              >> http://www.nabble.com/Submit-button-with-SimpleDialog-as-alert-tp21507820p21543247.html
              >>> Sent from the ydn-javascript mailing list archive at Nabble.com.
              >>>
              >>
              >>
              >>
              >>
              >
              >

              --
              View this message in context: http://www.nabble.com/Submit-button-with-SimpleDialog-as-alert-tp21507820p21673998.html
              Sent from the ydn-javascript mailing list archive at Nabble.com.
            • Marcel Overdijk
              repost/retry ... -- View this message in context: http://www.nabble.com/Submit-button-with-SimpleDialog-as-alert-tp21507820p21840320.html Sent from the
              Message 6 of 14 , Feb 4, 2009
              • 0 Attachment
                repost/retry


                Marcel Overdijk wrote:
                >
                > Any ideas? I'm still facing this problem...
                >
                >
                > Marcel Overdijk wrote:
                >>
                >> Hi,
                >>
                >> I understand how I can call a handler using onClick.
                >> But how can I then submit that button when the user clicked yes.
                >>
                >> As obj I could pass though the button object I guess, but then how to
                >> submit it?
                >>
                >> Note that my form has 2 submit buttons. One with value Edit and one with
                >> value Delete.
                >> So when submitting the form I have to know which button was pressed...
                >>
                >>
                >> Cheers,
                >> Marcel
                >>
                >>
                >>
                >> lou_tribal wrote:
                >>>
                >>> If you look at this example you will find everything you need:
                >>>
                >>> http://developer.yahoo.com/yui/examples/container/simpledialog-quickstart.html
                >>>
                >>> <
                >>>
                >>> <script type="text/javascri pt">
                >>> YAHOO.util.Event. onDOMReady( function () {
                >>> new YAHOO.widget. Button("delete", {onclick:{fn:myClickFunction,
                >>> obj:}} );
                >>> });
                >>> </script>
                >>>
                >>> --- In ydn-javascript@yahoogroups.com, Marcel Overdijk
                >>> <marceloverdijk@...> wrote:
                >>>>
                >>>>
                >>>> I'm wondering if somebody has an idea. I think this is very standard
                >>>> use
                >>>> case.
                >>>>
                >>>>
                >>>>
                >>>> Marcel Overdijk wrote:
                >>>> >
                >>>> > I'm creating a submit button on my page as below:
                >>>> >
                >>>> >
                >>>> >
                >>>> > <input type="submit" name="_action_Delete"
                >>>> > value="Delete" />
                >>>> >
                >>>> >
                >>>> > <script type="text/javascript">
                >>>> > YAHOO.util.Event.onDOMReady(function () {
                >>>> > new YAHOO.widget.Button("delete");
                >>>> > });
                >>>> > </script>
                >>>> >
                >>>> > The page/form contains additional button (e.g. edit) so the
                >>> name/value of
                >>>> > the button clicked is important.
                >>>> > In my backend I use this to determine which button was clicked and
                >>> execute
                >>>> > some action.
                >>>> >
                >>>> > Now before submitting a delete request I want the end-user to show
                >>> a alert
                >>>> > using a simpleDialog.
                >>>> > Before using Yui I used a simple alert which worked fine.
                >>>> >
                >>>> > I'm using this:
                >>>> >
                >>>> > // Define various event handlers for Dialog
                >>>> > var handleYes = function() {
                >>>> > alert("You clicked yes!");
                >>>> > this.hide();
                >>>> > };
                >>>> > var handleNo = function() {
                >>>> > this.hide();
                >>>> > };
                >>>> >
                >>>> > // Instantiate the Dialog
                >>>> > var simpledialog1 = new
                >>>> > YAHOO.widget.SimpleDialog("simpledialog1",
                >>>> > { width: "300px",
                >>>> > fixedcenter: true,
                >>>> > visible: false,
                >>>> > draggable: false,
                >>>> > close: true,
                >>>> > text: "Do you want to continue?",
                >>>> > icon:
                >>>> > YAHOO.widget.SimpleDialog.ICON_HELP,
                >>>> > constraintoviewport: true,
                >>>> > modal: true,
                >>>> > buttons: [ { text:"Yes",
                >>>> > handler:handleYes, isDefault:true },
                >>>> > { text:"No",
                >>>> > handler:handleNo } ]
                >>>> > } );
                >>>> > simpledialog1.setHeader("Are you sure?");
                >>>> > simpledialog1.render("container");
                >>>> >
                >>>> > YAHOO.util.Event.addListener("show", "click",
                >>>> > simpledialog1.show, simpledialog1, true);
                >>>> >
                >>>> > But I'm missing the final piece....
                >>>> >
                >>>> > How can hook up the dialog to the delete button click, and the when
                >>>> > pressing yes send the submit?
                >>>> >
                >>>>
                >>>> --
                >>>> View this message in context:
                >>> http://www.nabble.com/Submit-button-with-SimpleDialog-as-alert-tp21507820p21543247.html
                >>>> Sent from the ydn-javascript mailing list archive at Nabble.com.
                >>>>
                >>>
                >>>
                >>>
                >>>
                >>
                >>
                >
                >

                --
                View this message in context: http://www.nabble.com/Submit-button-with-SimpleDialog-as-alert-tp21507820p21840320.html
                Sent from the ydn-javascript mailing list archive at Nabble.com.
              • bretlevy
                Hi Marcel: See if this helps you any: http://yuihelp.levycodev.com/demos/dialog/confirm_on_submit.php ~~bret ... how to ... one with ... pressed... ...
                Message 7 of 14 , Feb 4, 2009
                • 0 Attachment
                  Hi Marcel:

                  See if this helps you any:

                  http://yuihelp.levycodev.com/demos/dialog/confirm_on_submit.php

                  ~~bret


                  --- In ydn-javascript@yahoogroups.com, Marcel Overdijk
                  <marceloverdijk@...> wrote:
                  >
                  >
                  > repost/retry
                  >
                  >
                  > Marcel Overdijk wrote:
                  > >
                  > > Any ideas? I'm still facing this problem...
                  > >
                  > >
                  > > Marcel Overdijk wrote:
                  > >>
                  > >> Hi,
                  > >>
                  > >> I understand how I can call a handler using onClick.
                  > >> But how can I then submit that button when the user clicked yes.
                  > >>
                  > >> As obj I could pass though the button object I guess, but then
                  how to
                  > >> submit it?
                  > >>
                  > >> Note that my form has 2 submit buttons. One with value Edit and
                  one with
                  > >> value Delete.
                  > >> So when submitting the form I have to know which button was
                  pressed...
                  > >>
                  > >>
                  > >> Cheers,
                  > >> Marcel
                  > >>
                  > >>
                  > >>
                  > >> lou_tribal wrote:
                  > >>>
                  > >>> If you look at this example you will find everything you need:
                  > >>>
                  > >>> http://developer.yahoo.com/yui/examples/container/simpledialog-
                  quickstart.html
                  > >>>
                  > >>> <
                  > >>>
                  > >>> <script type="text/javascri pt">
                  > >>> YAHOO.util.Event. onDOMReady( function () {
                  > >>> new YAHOO.widget. Button("delete", {onclick:
                  {fn:myClickFunction,
                  > >>> obj:}} );
                  > >>> });
                  > >>> </script>
                  > >>>
                  > >>> --- In ydn-javascript@yahoogroups.com, Marcel Overdijk
                  > >>> <marceloverdijk@> wrote:
                  > >>>>
                  > >>>>
                  > >>>> I'm wondering if somebody has an idea. I think this is very
                  standard
                  > >>>> use
                  > >>>> case.
                  > >>>>
                  > >>>>
                  > >>>>
                  > >>>> Marcel Overdijk wrote:
                  > >>>> >
                  > >>>> > I'm creating a submit button on my page as below:
                  > >>>> >
                  > >>>> >
                  > >>>> >
                  > >>>> > <input type="submit"
                  name="_action_Delete"
                  > >>>> > value="Delete" />
                  > >>>> >
                  > >>>> >
                  > >>>> > <script type="text/javascript">
                  > >>>> > YAHOO.util.Event.onDOMReady(function () {
                  > >>>> > new YAHOO.widget.Button("delete");
                  > >>>> > });
                  > >>>> > </script>
                  > >>>> >
                  > >>>> > The page/form contains additional button (e.g. edit) so the
                  > >>> name/value of
                  > >>>> > the button clicked is important.
                  > >>>> > In my backend I use this to determine which button was
                  clicked and
                  > >>> execute
                  > >>>> > some action.
                  > >>>> >
                  > >>>> > Now before submitting a delete request I want the end-user
                  to show
                  > >>> a alert
                  > >>>> > using a simpleDialog.
                  > >>>> > Before using Yui I used a simple alert which worked fine.
                  > >>>> >
                  > >>>> > I'm using this:
                  > >>>> >
                  > >>>> > // Define various event handlers for
                  Dialog
                  > >>>> > var handleYes = function() {
                  > >>>> > alert("You clicked yes!");
                  > >>>> > this.hide();
                  > >>>> > };
                  > >>>> > var handleNo = function() {
                  > >>>> > this.hide();
                  > >>>> > };
                  > >>>> >
                  > >>>> > // Instantiate the Dialog
                  > >>>> > var simpledialog1 = new
                  > >>>> > YAHOO.widget.SimpleDialog("simpledialog1",
                  > >>>> > { width: "300px",
                  > >>>> > fixedcenter: true,
                  > >>>> > visible: false,
                  > >>>> > draggable: false,
                  > >>>> > close: true,
                  > >>>> > text: "Do you want to
                  continue?",
                  > >>>> > icon:
                  > >>>> > YAHOO.widget.SimpleDialog.ICON_HELP,
                  > >>>> > constraintoviewport: true,
                  > >>>> > modal: true,
                  > >>>> > buttons: [ { text:"Yes",
                  > >>>> > handler:handleYes, isDefault:true },
                  > >>>> > { text:"No",
                  > >>>> > handler:handleNo } ]
                  > >>>> > } );
                  > >>>> > simpledialog1.setHeader("Are you
                  sure?");
                  > >>>> > simpledialog1.render("container");
                  > >>>> >
                  > >>>> > YAHOO.util.Event.addListener
                  ("show", "click",
                  > >>>> > simpledialog1.show, simpledialog1, true);
                  > >>>> >
                  > >>>> > But I'm missing the final piece....
                  > >>>> >
                  > >>>> > How can hook up the dialog to the delete button click, and
                  the when
                  > >>>> > pressing yes send the submit?
                  > >>>> >
                  > >>>>
                  > >>>> --
                  > >>>> View this message in context:
                  > >>> http://www.nabble.com/Submit-button-with-SimpleDialog-as-alert-
                  tp21507820p21543247.html
                  > >>>> Sent from the ydn-javascript mailing list archive at
                  Nabble.com.
                  > >>>>
                  > >>>
                  > >>>
                  > >>>
                  > >>>
                  > >>
                  > >>
                  > >
                  > >
                  >
                  > --
                  > View this message in context: http://www.nabble.com/Submit-button-
                  with-SimpleDialog-as-alert-tp21507820p21840320.html
                  > Sent from the ydn-javascript mailing list archive at Nabble.com.
                  >
                • Marcel Overdijk
                  Thanks Bret, That s exactly what i was looking for. Thanks again. Cheers, Marcel ... -- View this message in context:
                  Message 8 of 14 , Feb 5, 2009
                  • 0 Attachment
                    Thanks Bret,

                    That's exactly what i was looking for. Thanks again.

                    Cheers,
                    Marcel


                    bretlevy wrote:
                    >
                    >
                    > Hi Marcel:
                    >
                    > See if this helps you any:
                    >
                    > http://yuihelp.levycodev.com/demos/dialog/confirm_on_submit.php
                    >
                    > ~~bret
                    >
                    >
                    > --- In ydn-javascript@yahoogroups.com, Marcel Overdijk
                    > <marceloverdijk@...> wrote:
                    >>
                    >>
                    >> repost/retry
                    >>
                    >>
                    >> Marcel Overdijk wrote:
                    >> >
                    >> > Any ideas? I'm still facing this problem...
                    >> >
                    >> >
                    >> > Marcel Overdijk wrote:
                    >> >>
                    >> >> Hi,
                    >> >>
                    >> >> I understand how I can call a handler using onClick.
                    >> >> But how can I then submit that button when the user clicked yes.
                    >> >>
                    >> >> As obj I could pass though the button object I guess, but then
                    > how to
                    >> >> submit it?
                    >> >>
                    >> >> Note that my form has 2 submit buttons. One with value Edit and
                    > one with
                    >> >> value Delete.
                    >> >> So when submitting the form I have to know which button was
                    > pressed...
                    >> >>
                    >> >>
                    >> >> Cheers,
                    >> >> Marcel
                    >> >>
                    >> >>
                    >> >>
                    >> >> lou_tribal wrote:
                    >> >>>
                    >> >>> If you look at this example you will find everything you need:
                    >> >>>
                    >> >>> http://developer.yahoo.com/yui/examples/container/simpledialog-
                    > quickstart.html
                    >> >>>
                    >> >>> <
                    >> >>>
                    >> >>> <script type="text/javascri pt">
                    >> >>> YAHOO.util.Event. onDOMReady( function () {
                    >> >>> new YAHOO.widget. Button("delete", {onclick:
                    > {fn:myClickFunction,
                    >> >>> obj:}} );
                    >> >>> });
                    >> >>> </script>
                    >> >>>
                    >> >>> --- In ydn-javascript@yahoogroups.com, Marcel Overdijk
                    >> >>> <marceloverdijk@> wrote:
                    >> >>>>
                    >> >>>>
                    >> >>>> I'm wondering if somebody has an idea. I think this is very
                    > standard
                    >> >>>> use
                    >> >>>> case.
                    >> >>>>
                    >> >>>>
                    >> >>>>
                    >> >>>> Marcel Overdijk wrote:
                    >> >>>> >
                    >> >>>> > I'm creating a submit button on my page as below:
                    >> >>>> >
                    >> >>>> >
                    >> >>>> >
                    >> >>>> > <input type="submit"
                    > name="_action_Delete"
                    >> >>>> > value="Delete" />
                    >> >>>> >
                    >> >>>> >
                    >> >>>> > <script type="text/javascript">
                    >> >>>> > YAHOO.util.Event.onDOMReady(function () {
                    >> >>>> > new YAHOO.widget.Button("delete");
                    >> >>>> > });
                    >> >>>> > </script>
                    >> >>>> >
                    >> >>>> > The page/form contains additional button (e.g. edit) so the
                    >> >>> name/value of
                    >> >>>> > the button clicked is important.
                    >> >>>> > In my backend I use this to determine which button was
                    > clicked and
                    >> >>> execute
                    >> >>>> > some action.
                    >> >>>> >
                    >> >>>> > Now before submitting a delete request I want the end-user
                    > to show
                    >> >>> a alert
                    >> >>>> > using a simpleDialog.
                    >> >>>> > Before using Yui I used a simple alert which worked fine.
                    >> >>>> >
                    >> >>>> > I'm using this:
                    >> >>>> >
                    >> >>>> > // Define various event handlers for
                    > Dialog
                    >> >>>> > var handleYes = function() {
                    >> >>>> > alert("You clicked yes!");
                    >> >>>> > this.hide();
                    >> >>>> > };
                    >> >>>> > var handleNo = function() {
                    >> >>>> > this.hide();
                    >> >>>> > };
                    >> >>>> >
                    >> >>>> > // Instantiate the Dialog
                    >> >>>> > var simpledialog1 = new
                    >> >>>> > YAHOO.widget.SimpleDialog("simpledialog1",
                    >> >>>> > { width: "300px",
                    >> >>>> > fixedcenter: true,
                    >> >>>> > visible: false,
                    >> >>>> > draggable: false,
                    >> >>>> > close: true,
                    >> >>>> > text: "Do you want to
                    > continue?",
                    >> >>>> > icon:
                    >> >>>> > YAHOO.widget.SimpleDialog.ICON_HELP,
                    >> >>>> > constraintoviewport: true,
                    >> >>>> > modal: true,
                    >> >>>> > buttons: [ { text:"Yes",
                    >> >>>> > handler:handleYes, isDefault:true },
                    >> >>>> > { text:"No",
                    >> >>>> > handler:handleNo } ]
                    >> >>>> > } );
                    >> >>>> > simpledialog1.setHeader("Are you
                    > sure?");
                    >> >>>> > simpledialog1.render("container");
                    >> >>>> >
                    >> >>>> > YAHOO.util.Event.addListener
                    > ("show", "click",
                    >> >>>> > simpledialog1.show, simpledialog1, true);
                    >> >>>> >
                    >> >>>> > But I'm missing the final piece....
                    >> >>>> >
                    >> >>>> > How can hook up the dialog to the delete button click, and
                    > the when
                    >> >>>> > pressing yes send the submit?
                    >> >>>> >
                    >> >>>>
                    >> >>>> --
                    >> >>>> View this message in context:
                    >> >>> http://www.nabble.com/Submit-button-with-SimpleDialog-as-alert-
                    > tp21507820p21543247.html
                    >> >>>> Sent from the ydn-javascript mailing list archive at
                    > Nabble.com.
                    >> >>>>
                    >> >>>
                    >> >>>
                    >> >>>
                    >> >>>
                    >> >>
                    >> >>
                    >> >
                    >> >
                    >>
                    >> --
                    >> View this message in context: http://www.nabble.com/Submit-button-
                    > with-SimpleDialog-as-alert-tp21507820p21840320.html
                    >> Sent from the ydn-javascript mailing list archive at Nabble.com.
                    >>
                    >
                    >
                    >
                    >

                    --
                    View this message in context: http://www.nabble.com/Submit-button-with-SimpleDialog-as-alert-tp21507820p21846958.html
                    Sent from the ydn-javascript mailing list archive at Nabble.com.
                  • Marcel Overdijk
                    Hi Brett, I checked the code but found 1 problem. In sendForm function sendForm (frm, action) { frmDemo.hide(); YInfo ( At this point the form would be
                    Message 9 of 14 , Feb 5, 2009
                    • 0 Attachment
                      Hi Brett,

                      I checked the code but found 1 problem.

                      In sendForm

                      function sendForm (frm, action) {
                      frmDemo.hide();
                      YInfo ('At this point the form would be submitted via javascript
                      \"frm.submit()\" or via an ajax call. The requested action is
                      \''+action+'\'.');
                      }

                      you provide the action, but just send the form.

                      So this piece is still missing: I don't know which submit button was pressed
                      (e.g. delete or edit).
                      My server request checks this based on the value of the button which was
                      submitted...

                      Any idea?


                      bretlevy wrote:
                      >
                      >
                      > Hi Marcel:
                      >
                      > See if this helps you any:
                      >
                      > http://yuihelp.levycodev.com/demos/dialog/confirm_on_submit.php
                      >
                      > ~~bret
                      >
                      >
                      > --- In ydn-javascript@yahoogroups.com, Marcel Overdijk
                      > <marceloverdijk@...> wrote:
                      >>
                      >>
                      >> repost/retry
                      >>
                      >>
                      >> Marcel Overdijk wrote:
                      >> >
                      >> > Any ideas? I'm still facing this problem...
                      >> >
                      >> >
                      >> > Marcel Overdijk wrote:
                      >> >>
                      >> >> Hi,
                      >> >>
                      >> >> I understand how I can call a handler using onClick.
                      >> >> But how can I then submit that button when the user clicked yes.
                      >> >>
                      >> >> As obj I could pass though the button object I guess, but then
                      > how to
                      >> >> submit it?
                      >> >>
                      >> >> Note that my form has 2 submit buttons. One with value Edit and
                      > one with
                      >> >> value Delete.
                      >> >> So when submitting the form I have to know which button was
                      > pressed...
                      >> >>
                      >> >>
                      >> >> Cheers,
                      >> >> Marcel
                      >> >>
                      >> >>
                      >> >>
                      >> >> lou_tribal wrote:
                      >> >>>
                      >> >>> If you look at this example you will find everything you need:
                      >> >>>
                      >> >>> http://developer.yahoo.com/yui/examples/container/simpledialog-
                      > quickstart.html
                      >> >>>
                      >> >>> <
                      >> >>>
                      >> >>> <script type="text/javascri pt">
                      >> >>> YAHOO.util.Event. onDOMReady( function () {
                      >> >>> new YAHOO.widget. Button("delete", {onclick:
                      > {fn:myClickFunction,
                      >> >>> obj:}} );
                      >> >>> });
                      >> >>> </script>
                      >> >>>
                      >> >>> --- In ydn-javascript@yahoogroups.com, Marcel Overdijk
                      >> >>> <marceloverdijk@> wrote:
                      >> >>>>
                      >> >>>>
                      >> >>>> I'm wondering if somebody has an idea. I think this is very
                      > standard
                      >> >>>> use
                      >> >>>> case.
                      >> >>>>
                      >> >>>>
                      >> >>>>
                      >> >>>> Marcel Overdijk wrote:
                      >> >>>> >
                      >> >>>> > I'm creating a submit button on my page as below:
                      >> >>>> >
                      >> >>>> >
                      >> >>>> >
                      >> >>>> > <input type="submit"
                      > name="_action_Delete"
                      >> >>>> > value="Delete" />
                      >> >>>> >
                      >> >>>> >
                      >> >>>> > <script type="text/javascript">
                      >> >>>> > YAHOO.util.Event.onDOMReady(function () {
                      >> >>>> > new YAHOO.widget.Button("delete");
                      >> >>>> > });
                      >> >>>> > </script>
                      >> >>>> >
                      >> >>>> > The page/form contains additional button (e.g. edit) so the
                      >> >>> name/value of
                      >> >>>> > the button clicked is important.
                      >> >>>> > In my backend I use this to determine which button was
                      > clicked and
                      >> >>> execute
                      >> >>>> > some action.
                      >> >>>> >
                      >> >>>> > Now before submitting a delete request I want the end-user
                      > to show
                      >> >>> a alert
                      >> >>>> > using a simpleDialog.
                      >> >>>> > Before using Yui I used a simple alert which worked fine.
                      >> >>>> >
                      >> >>>> > I'm using this:
                      >> >>>> >
                      >> >>>> > // Define various event handlers for
                      > Dialog
                      >> >>>> > var handleYes = function() {
                      >> >>>> > alert("You clicked yes!");
                      >> >>>> > this.hide();
                      >> >>>> > };
                      >> >>>> > var handleNo = function() {
                      >> >>>> > this.hide();
                      >> >>>> > };
                      >> >>>> >
                      >> >>>> > // Instantiate the Dialog
                      >> >>>> > var simpledialog1 = new
                      >> >>>> > YAHOO.widget.SimpleDialog("simpledialog1",
                      >> >>>> > { width: "300px",
                      >> >>>> > fixedcenter: true,
                      >> >>>> > visible: false,
                      >> >>>> > draggable: false,
                      >> >>>> > close: true,
                      >> >>>> > text: "Do you want to
                      > continue?",
                      >> >>>> > icon:
                      >> >>>> > YAHOO.widget.SimpleDialog.ICON_HELP,
                      >> >>>> > constraintoviewport: true,
                      >> >>>> > modal: true,
                      >> >>>> > buttons: [ { text:"Yes",
                      >> >>>> > handler:handleYes, isDefault:true },
                      >> >>>> > { text:"No",
                      >> >>>> > handler:handleNo } ]
                      >> >>>> > } );
                      >> >>>> > simpledialog1.setHeader("Are you
                      > sure?");
                      >> >>>> > simpledialog1.render("container");
                      >> >>>> >
                      >> >>>> > YAHOO.util.Event.addListener
                      > ("show", "click",
                      >> >>>> > simpledialog1.show, simpledialog1, true);
                      >> >>>> >
                      >> >>>> > But I'm missing the final piece....
                      >> >>>> >
                      >> >>>> > How can hook up the dialog to the delete button click, and
                      > the when
                      >> >>>> > pressing yes send the submit?
                      >> >>>> >
                      >> >>>>
                      >> >>>> --
                      >> >>>> View this message in context:
                      >> >>> http://www.nabble.com/Submit-button-with-SimpleDialog-as-alert-
                      > tp21507820p21543247.html
                      >> >>>> Sent from the ydn-javascript mailing list archive at
                      > Nabble.com.
                      >> >>>>
                      >> >>>
                      >> >>>
                      >> >>>
                      >> >>>
                      >> >>
                      >> >>
                      >> >
                      >> >
                      >>
                      >> --
                      >> View this message in context: http://www.nabble.com/Submit-button-
                      > with-SimpleDialog-as-alert-tp21507820p21840320.html
                      >> Sent from the ydn-javascript mailing list archive at Nabble.com.
                      >>
                      >
                      >
                      >
                      >

                      --
                      View this message in context: http://www.nabble.com/Submit-button-with-SimpleDialog-as-alert-tp21507820p21850885.html
                      Sent from the ydn-javascript mailing list archive at Nabble.com.
                    • Francis Amanfo
                      Hi Marcel, In the sendForm implementation, you could make a call to your backend service passing to it a query parameter like actio=save or action=delete. Then
                      Message 10 of 14 , Feb 5, 2009
                      • 0 Attachment
                        Hi Marcel,

                        In the sendForm implementation, you could make a call to your backend service passing to it a query parameter like actio=save or action=delete.
                        Then in the backend implementation you retrieve this parameter and check.
                        Is this helpful?

                        Francis

                        On Thu, Feb 5, 2009 at 1:59 PM, Marcel Overdijk <marceloverdijk@...> wrote:


                        Hi Brett,

                        I checked the code but found 1 problem.

                        In sendForm

                        function sendForm (frm, action) {
                        frmDemo.hide();
                        YInfo ('At this point the form would be submitted via javascript
                        \"frm.submit()\" or via an ajax call. The requested action is
                        \''+action+'\'.');
                        }

                        you provide the action, but just send the form.

                        So this piece is still missing: I don't know which submit button was pressed
                        (e.g. delete or edit).
                        My server request checks this based on the value of the button which was
                        submitted...

                        Any idea?



                        bretlevy wrote:
                        >
                        >
                        > Hi Marcel:
                        >
                        > See if this helps you any:
                        >
                        > http://yuihelp.levycodev.com/demos/dialog/confirm_on_submit.php
                        >
                        > ~~bret
                        >
                        >
                        > --- In ydn-javascript@yahoogroups.com, Marcel Overdijk
                        > <marceloverdijk@...> wrote:
                        >>
                        >>
                        >> repost/retry
                        >>
                        >>
                        >> Marcel Overdijk wrote:
                        >> >
                        >> > Any ideas? I'm still facing this problem...
                        >> >
                        >> >
                        >> > Marcel Overdijk wrote:
                        >> >>
                        >> >> Hi,
                        >> >>
                        >> >> I understand how I can call a handler using onClick.
                        >> >> But how can I then submit that button when the user clicked yes.
                        >> >>
                        >> >> As obj I could pass though the button object I guess, but then
                        > how to
                        >> >> submit it?
                        >> >>
                        >> >> Note that my form has 2 submit buttons. One with value Edit and
                        > one with
                        >> >> value Delete.
                        >> >> So when submitting the form I have to know which button was
                        > pressed...
                        >> >>
                        >> >>
                        >> >> Cheers,
                        >> >> Marcel
                        >> >>
                        >> >>
                        >> >>
                        >> >> lou_tribal wrote:
                        >> >>>
                        >> >>> If you look at this example you will find everything you need:
                        >> >>>
                        >> >>> http://developer.yahoo.com/yui/examples/container/simpledialog-
                        > quickstart.html
                        >> >>>
                        >> >>> &lt;
                        >> >>>
                        >> >>> <script type="text/javascri pt">
                        >> >>> YAHOO.util.Event. onDOMReady( function () {
                        >> >>> new YAHOO.widget. Button("delete", {onclick:
                        > {fn:myClickFunction,
                        >> >>> obj:}} );
                        >> >>> });
                        >> >>> </script>
                        >> >>>
                        >> >>> --- In ydn-javascript@yahoogroups.com, Marcel Overdijk
                        >> >>> <marceloverdijk@> wrote:
                        >> >>>>
                        >> >>>>
                        >> >>>> I'm wondering if somebody has an idea. I think this is very
                        > standard
                        >> >>>> use
                        >> >>>> case.
                        >> >>>>
                        >> >>>>
                        >> >>>>
                        >> >>>> Marcel Overdijk wrote:
                        >> >>>> >
                        >> >>>> > I'm creating a submit button on my page as below:
                        >> >>>> >
                        >> >>>> >
                        >> >>>> >
                        >> >>>> > <input type="submit"
                        > name="_action_Delete"
                        >> >>>> > value="Delete" />
                        >> >>>> >
                        >> >>>> >
                        >> >>>> > <script type="text/javascript">
                        >> >>>> > YAHOO.util.Event.onDOMReady(function () {
                        >> >>>> > new YAHOO.widget.Button("delete");
                        >> >>>> > });
                        >> >>>> > </script>
                        >> >>>> >
                        >> >>>> > The page/form contains additional button (e.g. edit) so the
                        >> >>> name/value of
                        >> >>>> > the button clicked is important.
                        >> >>>> > In my backend I use this to determine which button was
                        > clicked and
                        >> >>> execute
                        >> >>>> > some action.
                        >> >>>> >
                        >> >>>> > Now before submitting a delete request I want the end-user
                        > to show
                        >> >>> a alert
                        >> >>>> > using a simpleDialog.
                        >> >>>> > Before using Yui I used a simple alert which worked fine.
                        >> >>>> >
                        >> >>>> > I'm using this:
                        >> >>>> >
                        >> >>>> > // Define various event handlers for
                        > Dialog
                        >> >>>> > var handleYes = function() {
                        >> >>>> > alert("You clicked yes!");
                        >> >>>> > this.hide();
                        >> >>>> > };
                        >> >>>> > var handleNo = function() {
                        >> >>>> > this.hide();
                        >> >>>> > };
                        >> >>>> >
                        >> >>>> > // Instantiate the Dialog
                        >> >>>> > var simpledialog1 = new
                        >> >>>> > YAHOO.widget.SimpleDialog("simpledialog1",
                        >> >>>> > { width: "300px",
                        >> >>>> > fixedcenter: true,
                        >> >>>> > visible: false,
                        >> >>>> > draggable: false,
                        >> >>>> > close: true,
                        >> >>>> > text: "Do you want to
                        > continue?",
                        >> >>>> > icon:
                        >> >>>> > YAHOO.widget.SimpleDialog.ICON_HELP,
                        >> >>>> > constraintoviewport: true,
                        >> >>>> > modal: true,
                        >> >>>> > buttons: [ { text:"Yes",
                        >> >>>> > handler:handleYes, isDefault:true },
                        >> >>>> > { text:"No",
                        >> >>>> > handler:handleNo } ]
                        >> >>>> > } );
                        >> >>>> > simpledialog1.setHeader("Are you
                        > sure?");
                        >> >>>> > simpledialog1.render("container");
                        >> >>>> >
                        >> >>>> > YAHOO.util.Event.addListener
                        > ("show", "click",
                        >> >>>> > simpledialog1.show, simpledialog1, true);
                        >> >>>> >
                        >> >>>> > But I'm missing the final piece....
                        >> >>>> >
                        >> >>>> > How can hook up the dialog to the delete button click, and
                        > the when
                        >> >>>> > pressing yes send the submit?
                        >> >>>> >
                        >> >>>>
                        >> >>>> --
                        >> >>>> View this message in context:
                        >> >>> http://www.nabble.com/Submit-button-with-SimpleDialog-as-alert-
                        > tp21507820p21543247.html
                        >> >>>> Sent from the ydn-javascript mailing list archive at
                        > Nabble.com.
                        >> >>>>
                        >> >>>
                        >> >>>
                        >> >>>
                        >> >>>
                        >> >>
                        >> >>
                        >> >
                        >> >
                        >>
                        >> --
                        >> View this message in context: http://www.nabble.com/Submit-button-
                        > with-SimpleDialog-as-alert-tp21507820p21840320.html
                        >> Sent from the ydn-javascript mailing list archive at Nabble.com.
                        >>
                        >
                        >
                        >
                        >

                        --
                        View this message in context: http://www.nabble.com/Submit-button-with-SimpleDialog-as-alert-tp21507820p21850885.html

                        Sent from the ydn-javascript mailing list archive at Nabble.com.




                        --
                        Beware of bugs in the above code;
                        I have only proved it correct, not tried it.
                                                           -Donald Knuth
                      • bretlevy
                        If you view source , you are seeing a dummy sendForm. The sendForm function that actually sends the form and tells the server which button was pressed is
                        Message 11 of 14 , Feb 5, 2009
                        • 0 Attachment
                          If you "view source", you are seeing a "dummy" sendForm. The
                          sendForm function that actually sends the form and tells the server
                          which button was pressed is in the "help text" panel. It looks like
                          this:

                          function sendForm (frm, action) {
                          frm.action.value = action;
                          frm.somethingelse.value = 'YUI is awesome!';
                          frm.submit();
                          }

                          What it does is take the action (which in the example is the
                          text 'save' or 'delete' depending upon which button was sent) and
                          insert that value into a hidden field in the form (along with another
                          dummy value for dempnstration purposes). The server would then check
                          the 'action' parameter to determine which button was hit.

                          In a real scenario, you would also probably have the record id in a
                          hidden field so you knew which record was being acted upon.

                          If you have PHP 0n your server, for example, you would tell which
                          button was hit by looking at the variable $_GET["action"] (if your
                          <form> tag has method="GET" attribute) or $_POST["action"] (if <form>
                          is method="POST").

                          Does that calrify it? If not, feel free to email me directly for
                          more insight...

                          ~~bret



                          --- In ydn-javascript@yahoogroups.com, Marcel Overdijk
                          <marceloverdijk@...> wrote:
                          >
                          >
                          > Hi Brett,
                          >
                          > I checked the code but found 1 problem.
                          >
                          > In sendForm
                          >
                          > function sendForm (frm, action) {
                          > frmDemo.hide();
                          > YInfo ('At this point the form would be submitted via
                          javascript
                          > \"frm.submit()\" or via an ajax call. The requested action is
                          > \''+action+'\'.');
                          > }
                          >
                          > you provide the action, but just send the form.
                          >
                          > So this piece is still missing: I don't know which submit button
                          was pressed
                          > (e.g. delete or edit).
                          > My server request checks this based on the value of the button
                          which was
                          > submitted...
                          >
                          > Any idea?
                          >
                          >
                          > bretlevy wrote:
                          > >
                          > >
                          > > Hi Marcel:
                          > >
                          > > See if this helps you any:
                          > >
                          > > http://yuihelp.levycodev.com/demos/dialog/confirm_on_submit.php
                          > >
                          > > ~~bret
                          > >
                          > >
                          > > --- In ydn-javascript@yahoogroups.com, Marcel Overdijk
                          > > <marceloverdijk@> wrote:
                          > >>
                          > >>
                          > >> repost/retry
                          > >>
                          > >>
                          > >> Marcel Overdijk wrote:
                          > >> >
                          > >> > Any ideas? I'm still facing this problem...
                          > >> >
                          > >> >
                          > >> > Marcel Overdijk wrote:
                          > >> >>
                          > >> >> Hi,
                          > >> >>
                          > >> >> I understand how I can call a handler using onClick.
                          > >> >> But how can I then submit that button when the user clicked
                          yes.
                          > >> >>
                          > >> >> As obj I could pass though the button object I guess, but
                          then
                          > > how to
                          > >> >> submit it?
                          > >> >>
                          > >> >> Note that my form has 2 submit buttons. One with value Edit
                          and
                          > > one with
                          > >> >> value Delete.
                          > >> >> So when submitting the form I have to know which button was
                          > > pressed...
                          > >> >>
                          > >> >>
                          > >> >> Cheers,
                          > >> >> Marcel
                          > >> >>
                          > >> >>
                          > >> >>
                          > >> >> lou_tribal wrote:
                          > >> >>>
                          > >> >>> If you look at this example you will find everything you
                          need:
                          > >> >>>
                          > >> >>>
                          http://developer.yahoo.com/yui/examples/container/simpledialog-
                          > > quickstart.html
                          > >> >>>
                          > >> >>> <
                          > >> >>>
                          > >> >>> <script type="text/javascri pt">
                          > >> >>> YAHOO.util.Event. onDOMReady( function () {
                          > >> >>> new YAHOO.widget. Button("delete", {onclick:
                          > > {fn:myClickFunction,
                          > >> >>> obj:}} );
                          > >> >>> });
                          > >> >>> </script>
                          > >> >>>
                          > >> >>> --- In ydn-javascript@yahoogroups.com, Marcel Overdijk
                          > >> >>> <marceloverdijk@> wrote:
                          > >> >>>>
                          > >> >>>>
                          > >> >>>> I'm wondering if somebody has an idea. I think this is very
                          > > standard
                          > >> >>>> use
                          > >> >>>> case.
                          > >> >>>>
                          > >> >>>>
                          > >> >>>>
                          > >> >>>> Marcel Overdijk wrote:
                          > >> >>>> >
                          > >> >>>> > I'm creating a submit button on my page as below:
                          > >> >>>> >
                          > >> >>>> >
                          > >> >>>> >
                          > >> >>>> > <input type="submit"
                          > > name="_action_Delete"
                          > >> >>>> > value="Delete" />
                          > >> >>>> >
                          > >> >>>> >
                          > >> >>>> > <script type="text/javascript">
                          > >> >>>> > YAHOO.util.Event.onDOMReady(function () {
                          > >> >>>> > new YAHOO.widget.Button("delete");
                          > >> >>>> > });
                          > >> >>>> > </script>
                          > >> >>>> >
                          > >> >>>> > The page/form contains additional button (e.g. edit) so
                          the
                          > >> >>> name/value of
                          > >> >>>> > the button clicked is important.
                          > >> >>>> > In my backend I use this to determine which button was
                          > > clicked and
                          > >> >>> execute
                          > >> >>>> > some action.
                          > >> >>>> >
                          > >> >>>> > Now before submitting a delete request I want the end-
                          user
                          > > to show
                          > >> >>> a alert
                          > >> >>>> > using a simpleDialog.
                          > >> >>>> > Before using Yui I used a simple alert which worked fine.
                          > >> >>>> >
                          > >> >>>> > I'm using this:
                          > >> >>>> >
                          > >> >>>> > // Define various event handlers
                          for
                          > > Dialog
                          > >> >>>> > var handleYes = function() {
                          > >> >>>> > alert("You clicked yes!");
                          > >> >>>> > this.hide();
                          > >> >>>> > };
                          > >> >>>> > var handleNo = function() {
                          > >> >>>> > this.hide();
                          > >> >>>> > };
                          > >> >>>> >
                          > >> >>>> > // Instantiate the Dialog
                          > >> >>>> > var simpledialog1 = new
                          > >> >>>> > YAHOO.widget.SimpleDialog("simpledialog1",
                          > >> >>>> > { width: "300px",
                          > >> >>>> > fixedcenter: true,
                          > >> >>>> > visible: false,
                          > >> >>>> > draggable: false,
                          > >> >>>> > close: true,
                          > >> >>>> > text: "Do you want to
                          > > continue?",
                          > >> >>>> > icon:
                          > >> >>>> > YAHOO.widget.SimpleDialog.ICON_HELP,
                          > >> >>>> > constraintoviewport:
                          true,
                          > >> >>>> > modal: true,
                          > >> >>>> > buttons: [ {
                          text:"Yes",
                          > >> >>>> > handler:handleYes, isDefault:true },
                          > >> >>>> > {
                          text:"No",
                          > >> >>>> > handler:handleNo } ]
                          > >> >>>> > } );
                          > >> >>>> > simpledialog1.setHeader("Are you
                          > > sure?");
                          > >> >>>> > simpledialog1.render("container");
                          > >> >>>> >
                          > >> >>>> > YAHOO.util.Event.addListener
                          > > ("show", "click",
                          > >> >>>> > simpledialog1.show, simpledialog1, true);
                          > >> >>>> >
                          > >> >>>> > But I'm missing the final piece....
                          > >> >>>> >
                          > >> >>>> > How can hook up the dialog to the delete button click,
                          and
                          > > the when
                          > >> >>>> > pressing yes send the submit?
                          > >> >>>> >
                          > >> >>>>
                          > >> >>>> --
                          > >> >>>> View this message in context:
                          > >> >>> http://www.nabble.com/Submit-button-with-SimpleDialog-as-
                          alert-
                          > > tp21507820p21543247.html
                          > >> >>>> Sent from the ydn-javascript mailing list archive at
                          > > Nabble.com.
                          > >> >>>>
                          > >> >>>
                          > >> >>>
                          > >> >>>
                          > >> >>>
                          > >> >>
                          > >> >>
                          > >> >
                          > >> >
                          > >>
                          > >> --
                          > >> View this message in context: http://www.nabble.com/Submit-
                          button-
                          > > with-SimpleDialog-as-alert-tp21507820p21840320.html
                          > >> Sent from the ydn-javascript mailing list archive at Nabble.com.
                          > >>
                          > >
                          > >
                          > >
                          > >
                          >
                          > --
                          > View this message in context: http://www.nabble.com/Submit-button-
                          with-SimpleDialog-as-alert-tp21507820p21850885.html
                          > Sent from the ydn-javascript mailing list archive at Nabble.com.
                          >
                        • bretlevy
                          I have expanded the demo with a little more explanation. See if it is better for you. http://yuihelp.levycodev.com/demos/dialog/confirm_on_submit.php ~~bret
                          Message 12 of 14 , Feb 5, 2009
                          • 0 Attachment
                            I have expanded the demo with a little more explanation. See if it
                            is better for you.

                            http://yuihelp.levycodev.com/demos/dialog/confirm_on_submit.php

                            ~~bret


                            --- In ydn-javascript@yahoogroups.com, Marcel Overdijk
                            <marceloverdijk@...> wrote:
                            >
                            >
                            > Hi Brett,
                            >
                            > I checked the code but found 1 problem.
                            >
                            > In sendForm
                            >
                            > function sendForm (frm, action) {
                            > frmDemo.hide();
                            > YInfo ('At this point the form would be submitted via
                            javascript
                            > \"frm.submit()\" or via an ajax call. The requested action is
                            > \''+action+'\'.');
                            > }
                            >
                            > you provide the action, but just send the form.
                            >
                            > So this piece is still missing: I don't know which submit button
                            was pressed
                            > (e.g. delete or edit).
                            > My server request checks this based on the value of the button
                            which was
                            > submitted...
                            >
                            > Any idea?
                            >
                            >
                            > bretlevy wrote:
                            > >
                            > >
                            > > Hi Marcel:
                            > >
                            > > See if this helps you any:
                            > >
                            > > http://yuihelp.levycodev.com/demos/dialog/confirm_on_submit.php
                            > >
                            > > ~~bret
                            > >
                            > >
                            > > --- In ydn-javascript@yahoogroups.com, Marcel Overdijk
                            > > <marceloverdijk@> wrote:
                            > >>
                            > >>
                            > >> repost/retry
                            > >>
                            > >>
                            > >> Marcel Overdijk wrote:
                            > >> >
                            > >> > Any ideas? I'm still facing this problem...
                            > >> >
                            > >> >
                            > >> > Marcel Overdijk wrote:
                            > >> >>
                            > >> >> Hi,
                            > >> >>
                            > >> >> I understand how I can call a handler using onClick.
                            > >> >> But how can I then submit that button when the user clicked
                            yes.
                            > >> >>
                            > >> >> As obj I could pass though the button object I guess, but
                            then
                            > > how to
                            > >> >> submit it?
                            > >> >>
                            > >> >> Note that my form has 2 submit buttons. One with value Edit
                            and
                            > > one with
                            > >> >> value Delete.
                            > >> >> So when submitting the form I have to know which button was
                            > > pressed...
                            > >> >>
                            > >> >>
                            > >> >> Cheers,
                            > >> >> Marcel
                            > >> >>
                            > >> >>
                            > >> >>
                            > >> >> lou_tribal wrote:
                            > >> >>>
                            > >> >>> If you look at this example you will find everything you
                            need:
                            > >> >>>
                            > >> >>>
                            http://developer.yahoo.com/yui/examples/container/simpledialog-
                            > > quickstart.html
                            > >> >>>
                            > >> >>> <
                            > >> >>>
                            > >> >>> <script type="text/javascri pt">
                            > >> >>> YAHOO.util.Event. onDOMReady( function () {
                            > >> >>> new YAHOO.widget. Button("delete", {onclick:
                            > > {fn:myClickFunction,
                            > >> >>> obj:}} );
                            > >> >>> });
                            > >> >>> </script>
                            > >> >>>
                            > >> >>> --- In ydn-javascript@yahoogroups.com, Marcel Overdijk
                            > >> >>> <marceloverdijk@> wrote:
                            > >> >>>>
                            > >> >>>>
                            > >> >>>> I'm wondering if somebody has an idea. I think this is very
                            > > standard
                            > >> >>>> use
                            > >> >>>> case.
                            > >> >>>>
                            > >> >>>>
                            > >> >>>>
                            > >> >>>> Marcel Overdijk wrote:
                            > >> >>>> >
                            > >> >>>> > I'm creating a submit button on my page as below:
                            > >> >>>> >
                            > >> >>>> >
                            > >> >>>> >
                            > >> >>>> > <input type="submit"
                            > > name="_action_Delete"
                            > >> >>>> > value="Delete" />
                            > >> >>>> >
                            > >> >>>> >
                            > >> >>>> > <script type="text/javascript">
                            > >> >>>> > YAHOO.util.Event.onDOMReady(function () {
                            > >> >>>> > new YAHOO.widget.Button("delete");
                            > >> >>>> > });
                            > >> >>>> > </script>
                            > >> >>>> >
                            > >> >>>> > The page/form contains additional button (e.g. edit) so
                            the
                            > >> >>> name/value of
                            > >> >>>> > the button clicked is important.
                            > >> >>>> > In my backend I use this to determine which button was
                            > > clicked and
                            > >> >>> execute
                            > >> >>>> > some action.
                            > >> >>>> >
                            > >> >>>> > Now before submitting a delete request I want the end-
                            user
                            > > to show
                            > >> >>> a alert
                            > >> >>>> > using a simpleDialog.
                            > >> >>>> > Before using Yui I used a simple alert which worked fine.
                            > >> >>>> >
                            > >> >>>> > I'm using this:
                            > >> >>>> >
                            > >> >>>> > // Define various event handlers
                            for
                            > > Dialog
                            > >> >>>> > var handleYes = function() {
                            > >> >>>> > alert("You clicked yes!");
                            > >> >>>> > this.hide();
                            > >> >>>> > };
                            > >> >>>> > var handleNo = function() {
                            > >> >>>> > this.hide();
                            > >> >>>> > };
                            > >> >>>> >
                            > >> >>>> > // Instantiate the Dialog
                            > >> >>>> > var simpledialog1 = new
                            > >> >>>> > YAHOO.widget.SimpleDialog("simpledialog1",
                            > >> >>>> > { width: "300px",
                            > >> >>>> > fixedcenter: true,
                            > >> >>>> > visible: false,
                            > >> >>>> > draggable: false,
                            > >> >>>> > close: true,
                            > >> >>>> > text: "Do you want to
                            > > continue?",
                            > >> >>>> > icon:
                            > >> >>>> > YAHOO.widget.SimpleDialog.ICON_HELP,
                            > >> >>>> > constraintoviewport:
                            true,
                            > >> >>>> > modal: true,
                            > >> >>>> > buttons: [ {
                            text:"Yes",
                            > >> >>>> > handler:handleYes, isDefault:true },
                            > >> >>>> > {
                            text:"No",
                            > >> >>>> > handler:handleNo } ]
                            > >> >>>> > } );
                            > >> >>>> > simpledialog1.setHeader("Are you
                            > > sure?");
                            > >> >>>> > simpledialog1.render("container");
                            > >> >>>> >
                            > >> >>>> > YAHOO.util.Event.addListener
                            > > ("show", "click",
                            > >> >>>> > simpledialog1.show, simpledialog1, true);
                            > >> >>>> >
                            > >> >>>> > But I'm missing the final piece....
                            > >> >>>> >
                            > >> >>>> > How can hook up the dialog to the delete button click,
                            and
                            > > the when
                            > >> >>>> > pressing yes send the submit?
                            > >> >>>> >
                            > >> >>>>
                            > >> >>>> --
                            > >> >>>> View this message in context:
                            > >> >>> http://www.nabble.com/Submit-button-with-SimpleDialog-as-
                            alert-
                            > > tp21507820p21543247.html
                            > >> >>>> Sent from the ydn-javascript mailing list archive at
                            > > Nabble.com.
                            > >> >>>>
                            > >> >>>
                            > >> >>>
                            > >> >>>
                            > >> >>>
                            > >> >>
                            > >> >>
                            > >> >
                            > >> >
                            > >>
                            > >> --
                            > >> View this message in context: http://www.nabble.com/Submit-
                            button-
                            > > with-SimpleDialog-as-alert-tp21507820p21840320.html
                            > >> Sent from the ydn-javascript mailing list archive at Nabble.com.
                            > >>
                            > >
                            > >
                            > >
                            > >
                            >
                            > --
                            > View this message in context: http://www.nabble.com/Submit-button-
                            with-SimpleDialog-as-alert-tp21507820p21850885.html
                            > Sent from the ydn-javascript mailing list archive at Nabble.com.
                            >
                          • Marcel Overdijk
                            Thanks for your patience and the clarification Bret. I see/understand how you did it now. Cheers, Marcel ... -- View this message in context:
                            Message 13 of 14 , Feb 5, 2009
                            • 0 Attachment
                              Thanks for your patience and the clarification Bret.
                              I see/understand how you did it now.

                              Cheers,
                              Marcel


                              bretlevy wrote:
                              >
                              >
                              > I have expanded the demo with a little more explanation. See if it
                              > is better for you.
                              >
                              > http://yuihelp.levycodev.com/demos/dialog/confirm_on_submit.php
                              >
                              > ~~bret
                              >
                              >
                              > --- In ydn-javascript@yahoogroups.com, Marcel Overdijk
                              > <marceloverdijk@...> wrote:
                              >>
                              >>
                              >> Hi Brett,
                              >>
                              >> I checked the code but found 1 problem.
                              >>
                              >> In sendForm
                              >>
                              >> function sendForm (frm, action) {
                              >> frmDemo.hide();
                              >> YInfo ('At this point the form would be submitted via
                              > javascript
                              >> \"frm.submit()\" or via an ajax call. The requested action is
                              >> \''+action+'\'.');
                              >> }
                              >>
                              >> you provide the action, but just send the form.
                              >>
                              >> So this piece is still missing: I don't know which submit button
                              > was pressed
                              >> (e.g. delete or edit).
                              >> My server request checks this based on the value of the button
                              > which was
                              >> submitted...
                              >>
                              >> Any idea?
                              >>
                              >>
                              >> bretlevy wrote:
                              >> >
                              >> >
                              >> > Hi Marcel:
                              >> >
                              >> > See if this helps you any:
                              >> >
                              >> > http://yuihelp.levycodev.com/demos/dialog/confirm_on_submit.php
                              >> >
                              >> > ~~bret
                              >> >
                              >> >
                              >> > --- In ydn-javascript@yahoogroups.com, Marcel Overdijk
                              >> > <marceloverdijk@> wrote:
                              >> >>
                              >> >>
                              >> >> repost/retry
                              >> >>
                              >> >>
                              >> >> Marcel Overdijk wrote:
                              >> >> >
                              >> >> > Any ideas? I'm still facing this problem...
                              >> >> >
                              >> >> >
                              >> >> > Marcel Overdijk wrote:
                              >> >> >>
                              >> >> >> Hi,
                              >> >> >>
                              >> >> >> I understand how I can call a handler using onClick.
                              >> >> >> But how can I then submit that button when the user clicked
                              > yes.
                              >> >> >>
                              >> >> >> As obj I could pass though the button object I guess, but
                              > then
                              >> > how to
                              >> >> >> submit it?
                              >> >> >>
                              >> >> >> Note that my form has 2 submit buttons. One with value Edit
                              > and
                              >> > one with
                              >> >> >> value Delete.
                              >> >> >> So when submitting the form I have to know which button was
                              >> > pressed...
                              >> >> >>
                              >> >> >>
                              >> >> >> Cheers,
                              >> >> >> Marcel
                              >> >> >>
                              >> >> >>
                              >> >> >>
                              >> >> >> lou_tribal wrote:
                              >> >> >>>
                              >> >> >>> If you look at this example you will find everything you
                              > need:
                              >> >> >>>
                              >> >> >>>
                              > http://developer.yahoo.com/yui/examples/container/simpledialog-
                              >> > quickstart.html
                              >> >> >>>
                              >> >> >>> <
                              >> >> >>>
                              >> >> >>> <script type="text/javascri pt">
                              >> >> >>> YAHOO.util.Event. onDOMReady( function () {
                              >> >> >>> new YAHOO.widget. Button("delete", {onclick:
                              >> > {fn:myClickFunction,
                              >> >> >>> obj:}} );
                              >> >> >>> });
                              >> >> >>> </script>
                              >> >> >>>
                              >> >> >>> --- In ydn-javascript@yahoogroups.com, Marcel Overdijk
                              >> >> >>> <marceloverdijk@> wrote:
                              >> >> >>>>
                              >> >> >>>>
                              >> >> >>>> I'm wondering if somebody has an idea. I think this is very
                              >> > standard
                              >> >> >>>> use
                              >> >> >>>> case.
                              >> >> >>>>
                              >> >> >>>>
                              >> >> >>>>
                              >> >> >>>> Marcel Overdijk wrote:
                              >> >> >>>> >
                              >> >> >>>> > I'm creating a submit button on my page as below:
                              >> >> >>>> >
                              >> >> >>>> >
                              >> >> >>>> >
                              >> >> >>>> > <input type="submit"
                              >> > name="_action_Delete"
                              >> >> >>>> > value="Delete" />
                              >> >> >>>> >
                              >> >> >>>> >
                              >> >> >>>> > <script type="text/javascript">
                              >> >> >>>> > YAHOO.util.Event.onDOMReady(function () {
                              >> >> >>>> > new YAHOO.widget.Button("delete");
                              >> >> >>>> > });
                              >> >> >>>> > </script>
                              >> >> >>>> >
                              >> >> >>>> > The page/form contains additional button (e.g. edit) so
                              > the
                              >> >> >>> name/value of
                              >> >> >>>> > the button clicked is important.
                              >> >> >>>> > In my backend I use this to determine which button was
                              >> > clicked and
                              >> >> >>> execute
                              >> >> >>>> > some action.
                              >> >> >>>> >
                              >> >> >>>> > Now before submitting a delete request I want the end-
                              > user
                              >> > to show
                              >> >> >>> a alert
                              >> >> >>>> > using a simpleDialog.
                              >> >> >>>> > Before using Yui I used a simple alert which worked fine.
                              >> >> >>>> >
                              >> >> >>>> > I'm using this:
                              >> >> >>>> >
                              >> >> >>>> > // Define various event handlers
                              > for
                              >> > Dialog
                              >> >> >>>> > var handleYes = function() {
                              >> >> >>>> > alert("You clicked yes!");
                              >> >> >>>> > this.hide();
                              >> >> >>>> > };
                              >> >> >>>> > var handleNo = function() {
                              >> >> >>>> > this.hide();
                              >> >> >>>> > };
                              >> >> >>>> >
                              >> >> >>>> > // Instantiate the Dialog
                              >> >> >>>> > var simpledialog1 = new
                              >> >> >>>> > YAHOO.widget.SimpleDialog("simpledialog1",
                              >> >> >>>> > { width: "300px",
                              >> >> >>>> > fixedcenter: true,
                              >> >> >>>> > visible: false,
                              >> >> >>>> > draggable: false,
                              >> >> >>>> > close: true,
                              >> >> >>>> > text: "Do you want to
                              >> > continue?",
                              >> >> >>>> > icon:
                              >> >> >>>> > YAHOO.widget.SimpleDialog.ICON_HELP,
                              >> >> >>>> > constraintoviewport:
                              > true,
                              >> >> >>>> > modal: true,
                              >> >> >>>> > buttons: [ {
                              > text:"Yes",
                              >> >> >>>> > handler:handleYes, isDefault:true },
                              >> >> >>>> > {
                              > text:"No",
                              >> >> >>>> > handler:handleNo } ]
                              >> >> >>>> > } );
                              >> >> >>>> > simpledialog1.setHeader("Are you
                              >> > sure?");
                              >> >> >>>> > simpledialog1.render("container");
                              >> >> >>>> >
                              >> >> >>>> > YAHOO.util.Event.addListener
                              >> > ("show", "click",
                              >> >> >>>> > simpledialog1.show, simpledialog1, true);
                              >> >> >>>> >
                              >> >> >>>> > But I'm missing the final piece....
                              >> >> >>>> >
                              >> >> >>>> > How can hook up the dialog to the delete button click,
                              > and
                              >> > the when
                              >> >> >>>> > pressing yes send the submit?
                              >> >> >>>> >
                              >> >> >>>>
                              >> >> >>>> --
                              >> >> >>>> View this message in context:
                              >> >> >>> http://www.nabble.com/Submit-button-with-SimpleDialog-as-
                              > alert-
                              >> > tp21507820p21543247.html
                              >> >> >>>> Sent from the ydn-javascript mailing list archive at
                              >> > Nabble.com.
                              >> >> >>>>
                              >> >> >>>
                              >> >> >>>
                              >> >> >>>
                              >> >> >>>
                              >> >> >>
                              >> >> >>
                              >> >> >
                              >> >> >
                              >> >>
                              >> >> --
                              >> >> View this message in context: http://www.nabble.com/Submit-
                              > button-
                              >> > with-SimpleDialog-as-alert-tp21507820p21840320.html
                              >> >> Sent from the ydn-javascript mailing list archive at Nabble.com.
                              >> >>
                              >> >
                              >> >
                              >> >
                              >> >
                              >>
                              >> --
                              >> View this message in context: http://www.nabble.com/Submit-button-
                              > with-SimpleDialog-as-alert-tp21507820p21850885.html
                              >> Sent from the ydn-javascript mailing list archive at Nabble.com.
                              >>
                              >
                              >
                              >
                              >

                              --
                              View this message in context: http://www.nabble.com/Submit-button-with-SimpleDialog-as-alert-tp21507820p21859264.html
                              Sent from the ydn-javascript mailing list archive at Nabble.com.
                            • bretlevy
                              here to serve! ~~bret ... it ... clicked ... Edit ... was ... very ... () { ... so ... fine. ... handlers ... to ... you ... ( container ); ... Nabble.com. ...
                              Message 14 of 14 , Feb 5, 2009
                              • 0 Attachment
                                here to serve!

                                ~~bret

                                --- In ydn-javascript@yahoogroups.com, Marcel Overdijk
                                <marceloverdijk@...> wrote:
                                >
                                >
                                > Thanks for your patience and the clarification Bret.
                                > I see/understand how you did it now.
                                >
                                > Cheers,
                                > Marcel
                                >
                                >
                                > bretlevy wrote:
                                > >
                                > >
                                > > I have expanded the demo with a little more explanation. See if
                                it
                                > > is better for you.
                                > >
                                > > http://yuihelp.levycodev.com/demos/dialog/confirm_on_submit.php
                                > >
                                > > ~~bret
                                > >
                                > >
                                > > --- In ydn-javascript@yahoogroups.com, Marcel Overdijk
                                > > <marceloverdijk@> wrote:
                                > >>
                                > >>
                                > >> Hi Brett,
                                > >>
                                > >> I checked the code but found 1 problem.
                                > >>
                                > >> In sendForm
                                > >>
                                > >> function sendForm (frm, action) {
                                > >> frmDemo.hide();
                                > >> YInfo ('At this point the form would be submitted via
                                > > javascript
                                > >> \"frm.submit()\" or via an ajax call. The requested action is
                                > >> \''+action+'\'.');
                                > >> }
                                > >>
                                > >> you provide the action, but just send the form.
                                > >>
                                > >> So this piece is still missing: I don't know which submit button
                                > > was pressed
                                > >> (e.g. delete or edit).
                                > >> My server request checks this based on the value of the button
                                > > which was
                                > >> submitted...
                                > >>
                                > >> Any idea?
                                > >>
                                > >>
                                > >> bretlevy wrote:
                                > >> >
                                > >> >
                                > >> > Hi Marcel:
                                > >> >
                                > >> > See if this helps you any:
                                > >> >
                                > >> > http://yuihelp.levycodev.com/demos/dialog/confirm_on_submit.php
                                > >> >
                                > >> > ~~bret
                                > >> >
                                > >> >
                                > >> > --- In ydn-javascript@yahoogroups.com, Marcel Overdijk
                                > >> > <marceloverdijk@> wrote:
                                > >> >>
                                > >> >>
                                > >> >> repost/retry
                                > >> >>
                                > >> >>
                                > >> >> Marcel Overdijk wrote:
                                > >> >> >
                                > >> >> > Any ideas? I'm still facing this problem...
                                > >> >> >
                                > >> >> >
                                > >> >> > Marcel Overdijk wrote:
                                > >> >> >>
                                > >> >> >> Hi,
                                > >> >> >>
                                > >> >> >> I understand how I can call a handler using onClick.
                                > >> >> >> But how can I then submit that button when the user
                                clicked
                                > > yes.
                                > >> >> >>
                                > >> >> >> As obj I could pass though the button object I guess, but
                                > > then
                                > >> > how to
                                > >> >> >> submit it?
                                > >> >> >>
                                > >> >> >> Note that my form has 2 submit buttons. One with value
                                Edit
                                > > and
                                > >> > one with
                                > >> >> >> value Delete.
                                > >> >> >> So when submitting the form I have to know which button
                                was
                                > >> > pressed...
                                > >> >> >>
                                > >> >> >>
                                > >> >> >> Cheers,
                                > >> >> >> Marcel
                                > >> >> >>
                                > >> >> >>
                                > >> >> >>
                                > >> >> >> lou_tribal wrote:
                                > >> >> >>>
                                > >> >> >>> If you look at this example you will find everything you
                                > > need:
                                > >> >> >>>
                                > >> >> >>>
                                > > http://developer.yahoo.com/yui/examples/container/simpledialog-
                                > >> > quickstart.html
                                > >> >> >>>
                                > >> >> >>> <
                                > >> >> >>>
                                > >> >> >>> <script type="text/javascri pt">
                                > >> >> >>> YAHOO.util.Event. onDOMReady( function () {
                                > >> >> >>> new YAHOO.widget. Button("delete", {onclick:
                                > >> > {fn:myClickFunction,
                                > >> >> >>> obj:}} );
                                > >> >> >>> });
                                > >> >> >>> </script>
                                > >> >> >>>
                                > >> >> >>> --- In ydn-javascript@yahoogroups.com, Marcel Overdijk
                                > >> >> >>> <marceloverdijk@> wrote:
                                > >> >> >>>>
                                > >> >> >>>>
                                > >> >> >>>> I'm wondering if somebody has an idea. I think this is
                                very
                                > >> > standard
                                > >> >> >>>> use
                                > >> >> >>>> case.
                                > >> >> >>>>
                                > >> >> >>>>
                                > >> >> >>>>
                                > >> >> >>>> Marcel Overdijk wrote:
                                > >> >> >>>> >
                                > >> >> >>>> > I'm creating a submit button on my page as below:
                                > >> >> >>>> >
                                > >> >> >>>> >
                                > >> >> >>>> >
                                > >> >> >>>> > <input type="submit"
                                > >> > name="_action_Delete"
                                > >> >> >>>> > value="Delete" />
                                > >> >> >>>> >
                                > >> >> >>>> >
                                > >> >> >>>> > <script type="text/javascript">
                                > >> >> >>>> > YAHOO.util.Event.onDOMReady(function
                                () {
                                > >> >> >>>> > new YAHOO.widget.Button("delete");
                                > >> >> >>>> > });
                                > >> >> >>>> > </script>
                                > >> >> >>>> >
                                > >> >> >>>> > The page/form contains additional button (e.g. edit)
                                so
                                > > the
                                > >> >> >>> name/value of
                                > >> >> >>>> > the button clicked is important.
                                > >> >> >>>> > In my backend I use this to determine which button was
                                > >> > clicked and
                                > >> >> >>> execute
                                > >> >> >>>> > some action.
                                > >> >> >>>> >
                                > >> >> >>>> > Now before submitting a delete request I want the end-
                                > > user
                                > >> > to show
                                > >> >> >>> a alert
                                > >> >> >>>> > using a simpleDialog.
                                > >> >> >>>> > Before using Yui I used a simple alert which worked
                                fine.
                                > >> >> >>>> >
                                > >> >> >>>> > I'm using this:
                                > >> >> >>>> >
                                > >> >> >>>> > // Define various event
                                handlers
                                > > for
                                > >> > Dialog
                                > >> >> >>>> > var handleYes = function() {
                                > >> >> >>>> > alert("You clicked yes!");
                                > >> >> >>>> > this.hide();
                                > >> >> >>>> > };
                                > >> >> >>>> > var handleNo = function() {
                                > >> >> >>>> > this.hide();
                                > >> >> >>>> > };
                                > >> >> >>>> >
                                > >> >> >>>> > // Instantiate the Dialog
                                > >> >> >>>> > var simpledialog1 = new
                                > >> >> >>>> > YAHOO.widget.SimpleDialog("simpledialog1",
                                > >> >> >>>> > { width: "300px",
                                > >> >> >>>> > fixedcenter: true,
                                > >> >> >>>> > visible: false,
                                > >> >> >>>> > draggable: false,
                                > >> >> >>>> > close: true,
                                > >> >> >>>> > text: "Do you want
                                to
                                > >> > continue?",
                                > >> >> >>>> > icon:
                                > >> >> >>>> > YAHOO.widget.SimpleDialog.ICON_HELP,
                                > >> >> >>>> >
                                constraintoviewport:
                                > > true,
                                > >> >> >>>> > modal: true,
                                > >> >> >>>> > buttons: [ {
                                > > text:"Yes",
                                > >> >> >>>> > handler:handleYes, isDefault:true },
                                > >> >> >>>> > {
                                > > text:"No",
                                > >> >> >>>> > handler:handleNo } ]
                                > >> >> >>>> > } );
                                > >> >> >>>> > simpledialog1.setHeader("Are
                                you
                                > >> > sure?");
                                > >> >> >>>> > simpledialog1.render
                                ("container");
                                > >> >> >>>> >
                                > >> >> >>>> > YAHOO.util.Event.addListener
                                > >> > ("show", "click",
                                > >> >> >>>> > simpledialog1.show, simpledialog1, true);
                                > >> >> >>>> >
                                > >> >> >>>> > But I'm missing the final piece....
                                > >> >> >>>> >
                                > >> >> >>>> > How can hook up the dialog to the delete button click,
                                > > and
                                > >> > the when
                                > >> >> >>>> > pressing yes send the submit?
                                > >> >> >>>> >
                                > >> >> >>>>
                                > >> >> >>>> --
                                > >> >> >>>> View this message in context:
                                > >> >> >>> http://www.nabble.com/Submit-button-with-SimpleDialog-as-
                                > > alert-
                                > >> > tp21507820p21543247.html
                                > >> >> >>>> Sent from the ydn-javascript mailing list archive at
                                > >> > Nabble.com.
                                > >> >> >>>>
                                > >> >> >>>
                                > >> >> >>>
                                > >> >> >>>
                                > >> >> >>>
                                > >> >> >>
                                > >> >> >>
                                > >> >> >
                                > >> >> >
                                > >> >>
                                > >> >> --
                                > >> >> View this message in context: http://www.nabble.com/Submit-
                                > > button-
                                > >> > with-SimpleDialog-as-alert-tp21507820p21840320.html
                                > >> >> Sent from the ydn-javascript mailing list archive at
                                Nabble.com.
                                > >> >>
                                > >> >
                                > >> >
                                > >> >
                                > >> >
                                > >>
                                > >> --
                                > >> View this message in context: http://www.nabble.com/Submit-
                                button-
                                > > with-SimpleDialog-as-alert-tp21507820p21850885.html
                                > >> Sent from the ydn-javascript mailing list archive at Nabble.com.
                                > >>
                                > >
                                > >
                                > >
                                > >
                                >
                                > --
                                > View this message in context: http://www.nabble.com/Submit-button-
                                with-SimpleDialog-as-alert-tp21507820p21859264.html
                                > Sent from the ydn-javascript mailing list archive at Nabble.com.
                                >
                              Your message has been successfully submitted and would be delivered to recipients shortly.