I have an area sliding down when clicking on a div around a textbox, this area then reveals another text box and a button...essentially all the controls to submit a question (title, content, submit button).
However I want the area revealed to slide back up if the user has clicked on anything except either of the two textboxes or the button.
What I need is a jquery method to call on the onBlur for the two textboxes and button to check if the textboxes or the button is not in focus which will slide up (.slideUp) the area.
How i am making the question content slide down is simple enough...
$(function () {
$('.QuestionContentExpandClick').click(function () {
/**** Slide the content div ****/
var viewContent = $('#DivExpandQuestionContentArea');
viewContent.slideDown('slow', function () {
});
});
});
This is the .net controls being used.
<asp:PlaceHolder ID="PhdTopQuestionArea" runat="server">
<div class="KBTopQuestionContainer">
<asp:TextBox ID="TxtQuestionReference" CssClass="QuestionReference" runat="server" />
<asp:HiddenField ID="HidQuestionTracker" runat="server" />
<table class="Table100PercentWidth">
<tr>
<td id="TbcKBTopQuestionImageCell" runat="server" class="KBTopQuestionImageCell">
<asp:HyperLink ID="HlkAskQuestionProfileImage" runat="server">
<asp:Image ID="ImgAskQuestionProfileImage" runat="server" CssClass="KBTopQuestionImage" />
</asp:HyperLink>
</td>
<td>
<div class="KBTopQuestionContainerDiv">
<div id="DivExpandQuestionClickArea" runat="server">
<asp:HyperLink ID="HlkAskQuestionRedirect" runat="server" EnableViewState="false">
<asp:TextBox ID="TxtAskQuestionTitle" runat="server" CssClass="KBTopQuestionTitleTextbox" Text="Ask a Question about this topic..."
onfocus="feedbackTextBoxFocus(this,'Ask a Question about this topic...')" onblur="feedbackTextBoxBlur(this,'Ask a Question about this topic...')" />
</asp:HyperLink>
</div>
<div id="DivExpandQuestionContentArea" style="display:none;">
<div style="margin-top:15px;">
<asp:TextBox ID="TxtAskQuestionContent" runat="server" TextMode="MultiLine" Rows="7" CssClass="KBTopQuestionContentTextbox" Text="Add the content for your question..."
onfocus="feedbackTextBoxFocus(this,'Add the content for your question...')" onblur="feedbackTextBoxBlur(this,'Add the content for your question...')" />
</div>
<div style="text-align:right;margin-top:10px;">
<asp:Button ID="BtnAskQuestion" runat="server" CssClass="KBTopQuestionButton" Text="Post Question" OnClick="BtnAskQuestion_Click" />
</div>
</div>
</div>
</td>
</tr>
</table>
</div>
Thanks in advance for any help :)