bind data to textbox based on combobox selected valueshttp://forums.asp.net/t/1792861.aspx/1?bind+data+to+textbox+based+on+combobox+selected+valuesSat, 14 Apr 2012 16:48:21 -040017928614932350http://forums.asp.net/p/1792861/4932350.aspx/1?bind+data+to+textbox+based+on+combobox+selected+valuesbind data to textbox based on combobox selected values <p>hi to all ,</p> <p>am doing a razor app. am using telerik controls. i hve to bind data to textbox based on combobox selected values. how to do it plz help me.</p> 2012-04-14T11:42:18-04:004932586http://forums.asp.net/p/1792861/4932586.aspx/1?Re+bind+data+to+textbox+based+on+combobox+selected+valuesRe: bind data to textbox based on combobox selected values <p>You're going to have to write some client side javascript to handle the combobox client side events.<br> Take a look at this<br> <a href="http://demos.telerik.com/aspnet-mvc/combobox/clientsideevents">http://demos.telerik.com/aspnet-mvc/combobox/clientsideevents</a></p> <p><a href="http://demos.telerik.com/aspnet-mvc/combobox/clientsideevents"></a>Basically you're going to have to add something like this in the razor view:</p> <pre class="prettyprint">@(Html.Telerik().ComboBox() //... normal combobox initialization code .ClientEvents(events =&gt; events.OnChange(&quot;onComboBoxChange&quot;)) //... )</pre> <p>Then you need a javascript section to handle the change:</p> <pre class="prettyprint"> &lt;script type="text/javascript"&gt; //ComboBox event handlers function onComboBoxChange(e) { var comboValue = e.value; //Assuming you have a textbox with an id or "textbox1" &lt;input type="text" id="texbox1" name="textbox1" /&gt; // You can do this using jquery &#36;("#textbox1").val(comboValue); } &lt;/script&gt;</pre> <p><br> <br> &nbsp;</p> 2012-04-14T16:48:21-04:00