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

TinyMCE Insert/Edit link not editable

 To fix this add  e.stopImmediatePropagation()  as below. $(document).on('focusin', function (e) {             if ($(e.target).close...