| <html > |
| <body> |
| <p>This tests that we can find the selected value of a dropdown when this format is used: [select_name][this.selectedIndex].value. |
| See bug 798404. </p> |
| |
| <script> |
| if (window.testRunner) |
| testRunner.dumpAsText(); |
| |
| function test(selected_value) { |
| if (selected_value == 'C') { |
| document.getElementById("sourceViewDiv").innerHTML=' This test: PASSED!'; |
| } |
| } |
| </script> |
| |
| <form> |
| |
| <select name="URL" onChange="javascript:test(URL[this.selectedIndex].value);" > |
| <option value="A">A</option> |
| <option value="B">B</option> |
| <option value="C">C</option> |
| </select> |
| |
| <div id='sourceViewDiv'>This test: FAILED</div> |
| |
| <script> |
| var x=document.getElementsByTagName('select')[0]; |
| x.options[2].selected=true; |
| var evt = document.createEvent("HTMLEvents"); |
| evt.initEvent("change", true, true); |
| x.dispatchEvent(evt); |
| </script> |
| |
| </form> |
| |
| |
| </body> |
| </html> |