$(document).ready(function() { $("#reply_field", this) .val('Write a comment here...') .text($("td.win", this).length) .addClass("muted"); $("#reply_field").focus(function() { if( $(this).val() == "Write a comment here..." ) { $(this).val(""); $(this).addClass("unmuted"); } }); $('#reply_field').elastic(); //$('#reply_field').live("keydown", function(event) { // this fixed a problem with Lightbox f'ing up this feature //$('#reply_field').bind('keypress', function(event){ $('#reply_field').live("keydown", function(event) { if (event.which == 13) { var element = $(this); var topicid = element.attr("title"); var post_text = $(this).val(); var id = $(this).attr('id'); var label = $(this).attr('label'); $('.reply_area').replaceWith(''); $.ajax({ type: "POST", dataType: "text", cache: false, url: '/modules.php?op=modload&name=SquawkBox&file=index&req=quickreply&id=' + topicid, data: {id:topicid , text:post_text, lastpost:label}, success: function(html) { if(html) { $('#updated_posts').append(html); } } }); return false; } }); $('.drop-down-show-hide').hide(); $('#pulldown').change(function () { $('.drop-down-show-hide').hide() $('#' + this.value).show(); }); });