Monday, August 15, 2011

Pass TextBox ID to javascript function


TextBox2.Attributes.Add("onkeyup", "Fill('" + TextBox1.ClientID.ToString() + "','" + TextBox2.ClientID.ToString() + "','" + TextBox3.ClientID.ToString() + "')")
 

<script type="text/javascript">
    function Fill(x, y, z) 
    {
            val1 = parseFloat(document.getElementById(x).value);
            val2 = parseFloat(document.getElementById(y).value);   
//code here         
    }
    </script>
 

No comments:

Post a Comment

How to Create Events Using Microsoft Graph API with Delegated Permissions and MSAL.js

Microsoft Graph API provides powerful capabilities to interact with Microsoft 365 services. In this guide, we’ll explore how to create calen...