How can I trigger an action when the user changes the option in a pull-down list?
Created May 4, 2012
Troy Niven Below is a simple example to show you how this can be done.
You can of course use the function to do anything that JavaScript is capable of doing.
<html> <head> <title>Some Title</title> <script language="javascript"> <!-- function someAction() { window.alert("Please Don't Change That :)"); document.form1.select1.selectedIndex=0; //you can change the above to anything you want return true; } //--> </script> </head> <body> <form name="form1"> <select onChange="someAction();" name="select1"> <option value="option1">1</option> <option value="option2">2</option> <option value="option3">3</option> </select> </form> </body> </html>