I got this to work with the help of a friend. For anyone else that is interested, here is the code sample:
Code:
<select name="category" id="category">
<option value="category1">Category 1</option>
<option value="category2">Category 2</option>
<option value="category3">Category 3</option>
</select>
<br/>
<textarea id="tweet" style="width: 350px; height: 50px">
I want to vote for XYZ in category #category1
</textarea>
$('#category').change(function(){
var text = $('#tweet').val();
text = text.replace(/#\w+/, '#' + $(this).val());
$('#tweet').val(text);
});
Bookmarks