Problem in finding controls present in edit form template using javascript function

2 posts, 0 answers
  1. : Arumuga Vignesh
    : Arumuga Vignesh  avatar
    21 posts
    Member since:
    Jul 2013

    Posted 24 Sep 2014 Link to this post

    Hi ,

         I have a doubt regarding how to find the controls which are present in form template of radgrid  in javascript function.

     In my web page i have used radgrid and inside that i have used editform template. In form template i have used 5 radnumeric textbox controls. I have to take the value from these textbox and sum it and have to show it in another textbox named as "Total" . The value should be auto calculated. So, for this i am using client side event onBlur. But i am not able to find the controls of the textbox which is present inside the form template in javascript function. Kindly help me to get the values of radnumeric textbox in javascript function.

    function test(sender, args) {
    var editIndex = $find("<%=txtValue1.ClientID %>"); 

    here txtValue1 is the ID of radnumeric textbox and i am getting null in editIndex.

  2. Viktor Tachev
    Viktor Tachev avatar
    1784 posts

    Posted 29 Sep 2014 Link to this post

    Hi Arumuga,

    If I understand the setup correctly, all RadNumericTextbox controls are placed in the same container. In this case you could get reference to the parent of the blurred input first and then get reference to the control that you need with the findControl client method. The event where the result will be calculated would look similar to the following:

    function onBlur(sender, args) {
        var textBox1;
        var textBox2;
        var textBoxTotal = $telerik.findControl(sender.get_parent().get_element(), "RadNumericTextBox3");
        var total;
        // get reference to the other RadNumericTextBox controls here
        // calculate the total
        // set the value for the last RadNumericTextBox

    The markup for the EditFormTemplate I used for testing is shown below:

    <EditFormSettings EditFormType="Template">
            <telerik:RadNumericTextBox runat="server" ID="RadNumericTextBox1" ClientEvents-OnBlur="onBlur" />
            <br />
            <telerik:RadNumericTextBox runat="server" ID="RadNumericTextBox2" ClientEvents-OnBlur="onBlur" />
            <br />
            <telerik:RadNumericTextBox runat="server" ID="RadNumericTextBox3" />

    Viktor Tachev

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top