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

problem with dialog from a dialog

Expand Messages
  • bobbicat71
    sorry for my english ... I need to open a dialog from another dialog, all of this are modal. I have 2 problems: 1. the first dialog opened is not modal. 2. in
    Message 1 of 1 , May 11, 2007
    • 0 Attachment
      sorry for my english ...
      I need to open a dialog from another dialog, all of this are modal.
      I have 2 problems:

      1. the first dialog opened is not modal.
      2. in IE browser i have some problems with displaing the select
      multiple in first dialog.

      Here is the code of the test page:
      ----------------------------------------------------------------------
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
      "http://www.w3.org/TR/html4/strict.dtd">
      <html>
      <head>
      <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">


      </head>
      <body>

      <!-- CSS -->
      <link rel="stylesheet" type="text/css"
      href="http://yui.yahooapis.com/2.2.2/build/container/assets/container.css">

      <!-- Dependencies -->
      <script type="text/javascript"
      src="http://yui.yahooapis.com/2.2.2/build/yahoo-dom-event/yahoo-dom-event.js"></script>

      <!-- OPTIONAL: Animation (only required if enabling Animation) -->
      <script type="text/javascript"
      src="http://yui.yahooapis.com/2.2.2/build/animation/animation-min.js"></script>

      <!-- OPTIONAL: Drag & Drop (only required if enabling Drag & Drop) -->
      <script type="text/javascript"
      src="http://yui.yahooapis.com/2.2.2/build/dragdrop/dragdrop-min.js"></script>

      <!-- OPTIONAL: Connection (only required if performing asynchronous
      submission) -->
      <script type="text/javascript"
      src="http://yui.yahooapis.com/2.2.2/build/connection/connection-min.js"></script>

      <!-- Source file -->
      <script type="text/javascript"
      src="http://yui.yahooapis.com/2.2.2/build/container/container-min.js"></script>

      <script>
      YAHOO.namespace("example.container");

      function init() {

      // Define various event handlers for Dialog
      var handleSubmit = function() {
      this.submit();
      };
      var handleCancel = function() {
      this.cancel();
      };

      // Instantiate the Dialog
      YAHOO.example.container.dialog1 = new YAHOO.widget.Dialog("dialog1",
      { width : "300px",
      fixedcenter : true,
      visible : false,
      constraintoviewport : true,
      modal : true,
      buttons : [ { text:"Submit", handler:handleSubmit,
      isDefault:true },
      { text:"Cancel", handler:handleCancel } ]
      } );

      YAHOO.example.container.dialog2 = new YAHOO.widget.Dialog("dialog2",
      { width : "300px",
      fixedcenter : true,
      visible : false,
      constraintoviewport : true,
      modal : true,
      buttons : [ { text:"Submit", handler:handleSubmit,
      isDefault:true },
      { text:"Cancel", handler:handleCancel } ]
      } );

      // Render the Dialog
      YAHOO.example.container.dialog1.render();
      YAHOO.example.container.dialog2.render();

      YAHOO.util.Event.addListener("show", "click",
      YAHOO.example.container.dialog1.show, YAHOO.example.container.dialog1,
      true);
      YAHOO.util.Event.addListener("hide", "click",
      YAHOO.example.container.dialog1.hide, YAHOO.example.container.dialog1,
      true);

      YAHOO.util.Event.addListener("show2", "click",
      YAHOO.example.container.dialog2.show, YAHOO.example.container.dialog2,
      true);
      }

      YAHOO.util.Event.addListener(window, "load", init);
      </script>
      <div>
      <button id="show">Show dialog1</button>
      <button id="hide">Hide dialog1</button>
      </div>

      <div id="dialog1">
      <div class="hd">Please enter your information</div>
      <div class="bd">
      <form method="POST" action="../assets/post.php">
      <label for="firstname">First Name:</label><input type="textbox"
      name="firstname" />
      <label for="lastname">Last Name:</label><input type="textbox"
      name="lastname" />
      <label for="email">E-mail:</label><input type="textbox"
      name="email" />

      <label for="state[]">State:</label>
      <select multiple name="state[]">
      <option value="California">California</option>
      <option value="New Jersey">New Jersey</option>
      <option value="New York">New York</option>
      </select>

      <div class="clear"></div>

      <label for="radiobuttons">Radio buttons:</label>
      <input type="radio" name="radiobuttons[]" value="1" checked/> 1
      <input type="radio" name="radiobuttons[]" value="2" /> 2

      <div class="clear"></div>

      <label for="check">Single checkbox:</label><input type="checkbox"
      name="check" value="1" /> 1

      <div class="clear"></div>

      <label for="textarea">Text area:</label><textarea
      name="textarea"></textarea>

      <div class="clear"></div>

      <label for="cbarray">Multi checkbox:</label>
      <input type="checkbox" name="cbarray[]" value="1" /> 1
      <input type="checkbox" name="cbarray[]" value="2" /> 2
      <button id="show2">Show dialog2</button>
      </form>
      </div>
      </div>

      <div id="dialog2">
      <div class="hd">Please enter your information</div>
      <div class="bd">
      <form method="POST" action="../assets/post.php">
      <label for="firstname">First Name:</label><input type="textbox"
      name="firstname" />
      <label for="lastname">Last Name:</label><input type="textbox"
      name="lastname" />
      <label for="email">E-mail:</label><input type="textbox"
      name="email" />

      <label for="state[]">State:</label>
      <select multiple name="state[]">
      <option value="California">California</option>
      <option value="New Jersey">New Jersey</option>
      <option value="New York">New York</option>
      </select>

      <div class="clear"></div>

      <label for="radiobuttons">Radio buttons:</label>
      <input type="radio" name="radiobuttons[]" value="1" checked/> 1
      <input type="radio" name="radiobuttons[]" value="2" /> 2

      <div class="clear"></div>

      <label for="check">Single checkbox:</label><input type="checkbox"
      name="check" value="1" /> 1

      <div class="clear"></div>

      <label for="textarea">Text area:</label><textarea
      name="textarea"></textarea>

      <div class="clear"></div>

      <label for="cbarray">Multi checkbox:</label>
      <input type="checkbox" name="cbarray[]" value="1" /> 1
      <input type="checkbox" name="cbarray[]" value="2" /> 2
      </form>
      </div>
      </div>

      <div id="resp">Server response will be displayed in this area</div>
      </body>
      </html>
    Your message has been successfully submitted and would be delivered to recipients shortly.