Objects in this mirror are closer to Microsoft Technologies. DNM objective is to help users on Microsoft technologies by providing Articles, snippets, Interview Questions.

11 June 2012

Calling button onclick JavaScript function from textbox onblur event


In the below snippet we will see how to call Javascript function which is written for button onclick event from textbox onblur event.

  <div>
   User name: <asp:TextBox ID="txtUserName" runat="server" onblur="javascript:document.getElementById('btnUserCheckAval').click();" ></asp:TextBox>
<asp:Button ID="btnUserCheckAval" Text="Check Availability" runat="server" OnClientClick="javascript:alert('Call JS Function');" />
    </div>
 
Output: alert message ‘Call JS Fuction’ will be invoked onblur of textbox or onclick of button.
 

0 Comments:

Post a Comment