I have the following code, which I thought would update a textarea with comments when the status dropdown changes, but I cannot get it to work. (This is why I'm a server side programmer). Could someone take a look and see where I'm screwing up?
Thanks in advance,
- Rieekan
Code:
<html>
<head>
<script language="javascript">
function StatusComment() {
var list = document.forms[0].status;
if ( ! list.options ) return;
var field = document.getElementById('comments');
var result = list.options[list.selectedIndex].value;
field.value = 'Status updated to '. result;
}
</script>
</head>
<body>
<form>
<select name="status" onChange="StatusComment();">
<option value="1" selected>Submitted</option>
<option value="2">Being Researched</option>
<option value="3">Inventoried</option>
<option value="4">Implemented</option>
</select>
<textarea name="comments"></textarea>
</form>
</body>
</html>
Thanks in advance,
- Rieekan