?
Solved

jquery autocompolete multiselect

Posted on 2016-08-14
10
Medium Priority
?
30 Views
Last Modified: 2016-09-06
dear all
i jave a jquery autocomplete multiselect how to return the selection values into array
0
Comment
Question by:pamela rizk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 2
  • 2
10 Comments
 

Author Comment

by:pamela rizk
ID: 41755250
dear all

i select 1, test
then 2 'test2'
i need to fill into an array these 2 values
please help
0
 

Author Comment

by:pamela rizk
ID: 41755380
any news?
0
 
LVL 58

Expert Comment

by:Julian Hansen
ID: 41756020
Please post your code.
0
Not sure which OpenStack Certification to get?

So you’ve realized you might want to get certified in OpenStack, but you’re not sure what the benefits might be or even which one you should take. You know there are several certification courses you can choose from, but how do you know which one is right for you?

 
LVL 82

Expert Comment

by:leakim971
ID: 41756053
check this page : https://jqueryui.com/autocomplete/#multiple
look at source of the example
check this lines :
        select: function( event, ui ) {
          var terms = split( this.value );
          // remove the current input
          terms.pop();
          // add the selected item
          terms.push( ui.item.value );
          // add placeholder to get the comma-and-space at the end
          terms.push( "" );
          // terms is an array, we create a CSV string to update the value of the input
          this.value = terms.join( ", " ); 
          return false;
        }

Open in new window


You see terms is your array
0
 

Author Comment

by:pamela rizk
ID: 41766360
terms is the array separated by ", " but what if ui.item.value contains a value with , "?
0
 
LVL 82

Expert Comment

by:leakim971
ID: 41767793
Nothing... A string is not an array...
0
 

Author Comment

by:pamela rizk
ID: 41781160
I he the below string

dim k as string="Employee1, Boutros William Ton,Partner, Employee2, "

i am splitting this string as below :
  Dim NameValue As String =k
        Dim Nameelements() As String = NameValue.Split(New Char() {",  "}, StringSplitOptions.RemoveEmptyEntries)

but the output is not correct

i need the output to be an array with 3 columns :
Employee1
Boutros William Ton,Partner
Employee2

how to do that
0
 
LVL 58

Expert Comment

by:Julian Hansen
ID: 41781204
What output are you getting?

Note in this line you have a trailing comma
dim k as string="Employee1, Boutros William Ton,Partner, Employee2, "

Open in new window

This will result in an array of 4 items.
0
 

Accepted Solution

by:
pamela rizk earned 0 total points
ID: 41781207
i solved my problem using
Regex.Split(_k, ", ")
0
 

Author Closing Comment

by:pamela rizk
ID: 41785784
ok
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question