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

Client Api example not working?

2 Answers 52 Views
Input
This is a migrated thread and some comments may be shown as answers.
ABECON Groep BV
Top achievements
Rank 1
ABECON Groep BV asked on 20 Nov 2012, 04:23 PM

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 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 21 Nov 2012, 03:51 AM
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.
0
ABECON Groep BV
Top achievements
Rank 1
answered on 22 Nov 2012, 08:09 AM
Thanks, this helps!


Tags
Input
Asked by
ABECON Groep BV
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
ABECON Groep BV
Top achievements
Rank 1
Share this question
or