Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
275
Set WebTextEditor Text after WebDropDown changes without Postback
posted

Similar to the Cascading WebDropDown value

http://samples.infragistics.com/2010.1/WebFeatureBrowser/Default.aspx

How do you set a textbox value after the user selects a value of a dropdown  (without doing a postback)

I have a list of usernames in a dropdownlist.   When a name is selected I want to fire a server side event to lookup the phonebook from an arraylist depending on name selected and return that phone number to a WebTextEditor (or textbox)

On the cascading sample there is javascript

combo2.loadItems(eventArgs.getNewSelection()[0].get_text());

that calls the server side event

WebDropDown2.ItemsRequested +=

new DropDownItemsRequestedEventHandler

(WebDropDown2_ItemsRequested);

 

What would be the equipvalent to:

 

var text1 = $find('<%= WebTextEditor1.ClientID %>');

text1.set_text(???????????)

 

 

Parents
No Data
Reply
  • 24671
    posted

    Hi,

    I am not sure i understand the scenario completely, but in order to set the current text in the dropdown on the client-side you can do the following:

    var dropDown = $find('<%= WebDropDown1.ClientID %>');

    dropDown.set_currentValue('some value in the input', true); 

    Usually, if you select an item, the input value should get updated automatically. 

    Let me know if that helps

    Thanks, Angel 

Children