set_textboxvalue not working?

3 posts, 0 answers
  1. Nik
    Nik avatar
    51 posts
    Member since:
    Sep 2009

    Posted 19 Sep 2011 Link to this post

    I'm having some issues setting a rad textbox value. In a JS function, I'm copying the text from a data array and filling the textbox.
    var radTbLine = $find('radTbLine' + lineNum);
    radTbLine.set_textBoxValue(arrPrevLines[y]);

    When I debug the code, I can see the textbox has the new value all the way to the very end of the function. But the next time a function is triggered, the value is gone. When actually triggering this copy, I can see the value flash in the textbox and then immediately disappears. I made a test page with 2 textboxes and had js copy the text from one to the other, and that worked fine. This leads me to think that there is something else resetting my textbox, but since I stepped thru the code, I have no clue what that could be.

    Is there any reason why I shouldn't try doing getElementById('radTbLine1_text').value = 'test';?
  2. Nik
    Nik avatar
    51 posts
    Member since:
    Sep 2009

    Posted 19 Sep 2011 Link to this post

    Edit: I just found that my last statement, radtbline1.focus() was causing the issue. Why would that do that?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Josh
    Josh avatar
    7 posts
    Member since:
    May 2012

    Posted 15 Jul 2013 Link to this post

    I realize this is old but for others who find this post in the future, use .set_value(). Using .set_textboxvalue only displays the text but the data isn't actually there so focusing the control will clear the text.
Back to Top