|
6 | 6 |
|
7 | 7 | <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
|
8 | 8 | <link type="text/css" href="../../themes/base/jquery.ui.selectmenu.css" rel="stylesheet" />
|
9 |
| - <script type="text/javascript" src="../../jquery-1.4.2.js"></script> |
| 9 | + <script type="text/javascript" src="../../jquery-1.4.4.js"></script> |
10 | 10 | <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
|
11 | 11 | <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
|
12 | 12 | <script type="text/javascript" src="../../ui/jquery.ui.position.js"></script>
|
|
33 | 33 | <script type="text/javascript">
|
34 | 34 | $(function(){
|
35 | 35 |
|
36 |
| - // does not work see: http://github.com/fnagel/jquery-ui/issues#issue/12 |
| 36 | + // please note that option.event is always passed as a string, so do not test for true or 1 with if (options.value) |
| 37 | + // see this issue for more information http://github.com/fnagel/jquery-ui/issues#issue/12 |
37 | 38 | var speedA_depends = $('select#speedA_depends').selectmenu();
|
38 | 39 | var speedA = $('select#speedA').selectmenu({
|
39 | 40 | select: function(event, options) {
|
40 |
| - if (options.value) { |
| 41 | + if (options.value == "on") { |
41 | 42 | speedA_depends.selectmenu('enable');
|
42 | 43 | } else {
|
43 | 44 | speedA_depends.selectmenu('disable');
|
|
61 | 62 | </script>
|
62 | 63 | </head>
|
63 | 64 | <body>
|
| 65 | + <h2>Disable / Enable Testing</h2> |
64 | 66 | <form action="#">
|
| 67 | + <label for="speedA">Disabled by select callback (does not change original select)</label> |
65 | 68 | <fieldset>
|
66 |
| - <label for="speedA">Disabled by select callback (does not work)</label> |
67 | 69 | <select name="speedA" id="speedA">
|
68 |
| - <option value="1">On</option> |
69 |
| - <option value="0">Off</option> |
| 70 | + <option value="on">On</option> |
| 71 | + <option value="off">Off</option> |
70 | 72 | </select>
|
71 | 73 | <br />
|
72 |
| - <label for="speedA_depends">Depends on</label> |
73 | 74 | <select name="speedA_depends" id="speedA_depends">
|
74 | 75 | <option value="Slow">Slow</option>
|
75 | 76 | <option value="Medium">Medium</option>
|
|
0 commit comments