How to keep submit button visible and executable upon textarea onblur

Posted by ninumedia on Stack Overflow See other posts from Stack Overflow or by ninumedia
Published on 2010-05-12T03:46:09Z Indexed on 2010/05/12 3:54 UTC
Read the original article Hit count: 321

Filed under:
|

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();
});

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about blur