We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Dinamically change value property

Hi,
I would like to know if it's possible to dynamically change the value property of a control (Autocomplete or combobox) based on information that the user typed on a previous field.
Like when you autofill your address after you put your name on some browsers.
Thanks.

1 Reply

RJ Rekha J Syncfusion Team January 25, 2017 06:16 AM UTC

Hi Daniel,   
  
Thanks for Contacting Syncfusion Support.   
  
To achieve your requirement, we suggest that you use the “selectValueByKey” method. In this method, you can dynamically select the value based on the key field. In our sample, you can select the name value from the first Autocomplete. In FocusOut event, you can dynamically select the address of the selected value by using the selectValueByKey()method.   
  
Please refer to the below code snippet to achieve this.   
   
<script>   
          
    function focusout(e) {   
        var obj = $("#selectcar").ejAutocomplete("instance");   
        //dynamically change value by using previous field   
        obj.selectValueByKey(e.value);   
        }   
      
</script>   
   
  
   
For your reference, please download the sample in the link below:   
  
Please refer to our online API reference documentation for Autocomplete:   
  
Regards,   
Rekha.   


Loader.
Up arrow icon