Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

Here is the problem i have a textbox, panel and ajaxToolkit:PopupControlExtender .when focus coming to that text box panel get visible. and user can select multiple values from that panel.

And after that when the focus change from that text box i want to hide that panel. i think problem is clear. Any idea?

Thanks in advance.
Posted
Updated 1-Jun-11 19:17pm
v2

Try this

XML
<script type="text/javascript">
        $(document).ready(function() {
          
           if ($("<%=txt.ClientID%>").is(":focus"))
{
$("<%=pnl.ClientID%>").show();
}
        });

$("txt.ClientID").blur(function(){
$("<%=pnl.ClientID%>").hide
});
    </script>
 
Share this answer
 
Comments
anvas kuttan 2-Jun-11 1:31am    
hi,
thank you for your reply it is not working . but i afraid it is my mistake . where i call this function
Kiran Sonawane 2-Jun-11 1:36am    
You don't need to call anything. Make sure you should replace the "pnl" with your panel id and "txt" with your texbox id
Kiran Sonawane 2-Jun-11 1:37am    
Put the script tag in the head tag
anvas kuttan 2-Jun-11 1:39am    
ya i done it .. put the code too but unfortunately it wont
work now my panel wont visible too
Kiran Sonawane 2-Jun-11 1:40am    
Can you show me ur aspx code
when the focus change from that text box i want to hide that panel. i think problem is clear
Well, does not sounds like any problem here. All you need is to attach a onFocusout or onBlurr event to the textbox. Once that is done, in the associated JavaScript method, just get the panel element and set it's display to hide once again.

Try!
 
Share this answer
 
Comments
anvas kuttan 2-Jun-11 1:26am    
hi, thanks for your reply .. i done the javascript part already but searching for the event . any suggestion or example
Sandeep Mewara 2-Jun-11 4:34am    
I already gave the event names! :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900