This is a migrated thread and some comments may be shown as answers.

set_textboxvalue not working?

2 Answers 87 Views
Input
This is a migrated thread and some comments may be shown as answers.
Nik
Top achievements
Rank 1
Nik asked on 19 Sep 2011, 04:24 PM
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 Answers, 1 is accepted

Sort by
0
Nik
Top achievements
Rank 1
answered on 19 Sep 2011, 04:33 PM
Edit: I just found that my last statement, radtbline1.focus() was causing the issue. Why would that do that?
0
Josh
Top achievements
Rank 1
answered on 15 Jul 2013, 04:22 PM
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.
Tags
Input
Asked by
Nik
Top achievements
Rank 1
Answers by
Nik
Top achievements
Rank 1
Josh
Top achievements
Rank 1
Share this question
or