How to keep submit button visible and executable upon textarea onblur
- by ninumedia
I have a <div id="comment_posting_holder"> tag that holds a form with two elements: a textarea box and a submit button.
I want to have the div tag (containing the textarea and submit button) disappear if I click somewhere "OTHER" than the submit button. I have a start for the code below. So upon leaving focus from the textarea, I can make the div tag disappear. I tried placing in a mouseclick event inside the blur function for the submit button but that did not work. Any suggestions? Thank you!
**Facebook does this with it's comments. If you click on a "Post your comment..." field the textarea appears and then it will disappear upon losing focus other than if you pressed the submit button.
$('textarea').blur(function() {
$('#comment_posting_holder).hide();
});