If you can use jQuery, you just need to add a piece of code to your main.php
$(document).ready(function() { $("#idOfYourSelect").change(function(changeEvent) { alert("Your value : " + $(this).val()); }); });
Assuming your <select> has at least id idOfYourSelect (or css class name or name is somthing, which allows you to extract it from javascript code)
This will add a listener to the change event and trigger a callback each time the value changes.
If you cannot use jQuery, it will be a little more complicated, you will have to play with browser differences and use addEventLister or attachEvent to add a listener.
attachEvent documentation (for old IE)
addEventListener for Firefox, webkit, etc.
I recommend you use jQuery, which will handle all these differences for you.
source share