Client Api example not working?

3 posts, 1 answers
  1. ABECON Groep BV
    ABECON Groep BV avatar
    28 posts
    Member since:
    Apr 2007

    Posted 20 Nov 2012 Link to this post

    Hello, I have some problems with the RadNumericTextBox.
    If is set the value

     

    var tbox = document.getElementById(elementId);
    if (tbox) {
        tbox.value = value;
    }

    The textbox display value is changed but if i click the textbox the value dissapears.
    So i tried to see if the online examples work, but that won't work either. Or i am missing the point.
    Ive updated to the latest release of the asp.net ajax controls.

    Can you help me?

    Greetings
    Marcel de Groot



  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 20 Nov 2012 Link to this post

    Hi,

    After inspecting your code I found that you are accessing the RadControls using document.getElementById(elementId). Using $find("<%= elementId.ClientID %>") is the recommended way to get reference to client-side objects. Please try the following code snippet to achieve your scenario.

    JS:
    var tbox = $find("<%=elementId.ClientID %>");
    if (tbox) {
       tbox.set_value(value);
     }

    Hope this helps.

    Regards,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. ABECON Groep BV
    ABECON Groep BV avatar
    28 posts
    Member since:
    Apr 2007

    Posted 22 Nov 2012 Link to this post

    Thanks, this helps!


Back to Top