Append select value to textarea
Hi i need to append the value of a select option to a textarea. Using the code below i have managed to do this. But when i keep changing the selection option it keeps adding the values in the textarea - is there anyway to clear the last selected upon selecting a new one?
- $('select.SelectTemplate').change(function() {
- var currentVal = $('textarea').val();
- $('textarea.AddMessage').val(currentVal + $(this).val());
- });
-
Many thanks for your help and patience.