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

RadNumericTextBox Set Value

2 Answers 1156 Views
Input
This is a migrated thread and some comments may be shown as answers.
Jibber4568
Top achievements
Rank 1
Jibber4568 asked on 05 Apr 2012, 12:33 PM
Hi guys, I was hoping you could provide some advice on setting the value of a RadNumericTextBox.

I have another control (dropdown) that when changed needs to update the RadNumericTextBox.

The javascript is firing and returning the current value as per below.

var txtTypeSelected = window["<%=txtOffsetPeriod2.ClientID %>"];
alert(txtTypeSelected.value);

However when I then try to set a new value this doesn't appear on screen as the control has had its id set as txtOffsetPeriod2_text.

txtTypeSelected.value = 1;

Is there another way I can set the RadNumericTextBox value when the function is called by another controls change event?

Thanks for the help.

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 05 Apr 2012, 01:17 PM
Hello,

 Try the following javascript to set RadNumericTextBox value on  ComboBox selectedindexchange.
JS:
function OnClientSelectedIndexChanged(sender, args)
  {
      var RadNumericTextBox1 = $find("<%= RadNumericTextBox1.ClientID %>");
      var txt = sender.get_selectedItem().get_text();
      RadNumericTextBox1 .set_value(txt);
  }

Thanks,
Princy.
0
Jibber4568
Top achievements
Rank 1
answered on 05 Apr 2012, 02:59 PM
Thanks Princy. Works perfectly.

Cheers
Tags
Input
Asked by
Jibber4568
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Jibber4568
Top achievements
Rank 1
Share this question
or