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

YUI Button Menu to Replace

Expand Messages
  • jeffmott@ymail.com
    I ve been trying to use a YUI button menu to replace a , and I ve used code lifted straight out of the examples, but I can t seem to get it to work. I
    Message 1 of 1 , May 26, 2009
    • 0 Attachment
      I've been trying to use a YUI button menu to replace a <select>, and I've used code lifted straight out of the examples, but I can't seem to get it to work. I get the buttons, but there's no menu's for them. What am I missing?

      Here's my code.

      <!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">
      <title></title>
      </head>
      <body class="yui-skin-sam">

      <p>

      <input type="submit" id="button1" name="button1" value="Button 1">
      <select id="button1select" name="button1select" multiple>
      <option value="0">One</option>
      <option value="1">Two</option>
      <option value="2">Three</option>
      </select>

      <input type="button" id="button2" name="button2" value="Button 2">
      <select id="button2select" name="button2select">
      <option value="0">One</option>
      <option value="1">Two</option>
      <option value="2">Three</option>
      </select>

      </p>

      <script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/yuiloader/yuiloader-min.js"></script>
      <script type="text/javascript">

      var loader = new YAHOO.util.YUILoader();

      loader.insert({
      require: ["button"],
      onSuccess: function(){

      var oButton1 = new YAHOO.widget.Button("button1", {
      type: "menu",
      menu: "button1select"
      });

      var oButton2 = new YAHOO.widget.Button("button2", {
      type: "menu",
      menu: "button2select"
      });

      }
      });

      </script>

      </body>
      </html>
    Your message has been successfully submitted and would be delivered to recipients shortly.