I have this simple HTML form:
<form action="">
<select name="channel">
<option value="#channel1">channel1</option>
<option value="#channel2">channel2</option>
</select>
</form>
and this JavaScript function:
/* Use this method to send a command to lightIRC with JavaScript */
function sendCommand(command) {
swfobject.getObjectById('lightIRC').sendCommand(command);
}
I want it so when I user clicks on a dropdown option the JavaScript command sendCommand('JOIN value');
is sent.
Value is the value from the <option>
.
Is it possible to do this? There is no submit button etc. I want it to work when the user simply clicks on a dropdown option.