php - Magicsuggest setValue() changes when move to other field -


on selectionchange setting new value when focus out setvalue change.

here code :

var ms=$('#mydiv').magicsuggest({             usecommakey: true,             hidetrigger: true,             placeholder: 'search here',             allowduplicates: false,             data: '/getdata.php',             ajaxconfig: {               xhrfields: {                 withcredentials: true,               }             },             valuefield: 'name',             renderer: function(data){                 return data.full_name;             },             resultasstring: true         });  $(ms).on('selectionchange', function(e, cb){             var response = cb.getvalue();             var respone_ary = response.tostring().split(',');             if(respone_ary.length > 1){                 this.removefromselection(cb.getselection());                 this.setvalue(respone_ary);             }         }); 

for example : in response getting "xyz,abc" want set 2 different bobble "xyz" "abc" . it's set when click on other filed change "xyz"

thanks in advance


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -