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

onchange event for input element

3 Answers 374 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Anatoly
Top achievements
Rank 1
Anatoly asked on 24 Jul 2008, 09:55 AM
Hi. I have a problem with handling onchange event in input element of RadComboBox. My custom combobox control derived from RadComboBox and overrides OnLoad server event:

protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
this.Page.ClientScript.RegisterStartupScript(this.GetType(),"blabla","$get('"+ this.ClientID + "_Input').onchange=\"AfterUpdate('" + this.ClientID + "')\";",true);
}

In resulted html I see:

<INPUT class="rcbInput" id="ctl00_hldrMain_ctl00_cmbDirectors_Input" style="DISPLAY: block" onchange="AfterUpdate('ctl00_hldrMain_ctl00_cmbDirectors')" name="ctl00$hldrMain$ctl00$cmbDirectors_Input" autocomplete="off" value="" />

onchange present but does not work. Please help.

3 Answers, 1 is accepted

Sort by
0
Anatoly
Top achievements
Rank 1
answered on 24 Jul 2008, 12:47 PM
resolved
this.Page.ClientScript.RegisterStartupScript(this.GetType(),"blabla","$get('"+ this.ClientID + "_Input').onchange=AfterUpdate;", true);
}
0
Accepted
Rosi
Telerik team
answered on 24 Jul 2008, 01:52 PM
Hello Anatoliy,

I suggest you modify your code by the following way:

this.Page.ClientScript.RegisterStartupScript(this.GetType(),"blabla",";$get('"this.ClientID + "_Input').onchange=function GoToAfterUpdate(){AfterUpdate('" + this.ClientID + "')};",true); 

Also you can check our online help documentation showing how you can use client-side events of RadComboBox.


Kind regards,
Rosi
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Anatoly
Top achievements
Rank 1
answered on 25 Jul 2008, 06:33 AM
Thanks
Tags
ComboBox
Asked by
Anatoly
Top achievements
Rank 1
Answers by
Anatoly
Top achievements
Rank 1
Rosi
Telerik team
Share this question
or