difficulties to retrieve the selected values and adding space to the values after the comma #217
-
Hello, I'm trying to retrieve the selected values from the select but I can't, indeed, I would like to be able to display the values even in a small alert to reassure me that I have what I need. Second, I want to add a space after each select value because in the database the data goes like this: Value1,Value2,Value3 ... I want it to be: Value1, Value2, Value3 ... Don't worry about spelling, it's a translated text, I don't speak English but I could still translate your answer too |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
@mafupaclement you can use the below code to get value with spaces. document.querySelector('#sample-multi-select').value.join(', ')
// returns "value1, value2, value3" |
Beta Was this translation helpful? Give feedback.
-
Thank you very much, it's solved. Now I would like to know how to use the "name" property to be able to send the content of the virtual-select on the server side. I don't know how to deal with the syntax. Sincerely. Dylan-Clement |
Beta Was this translation helpful? Give feedback.
@mafupaclement you can use the below code to get value with spaces.