twitter bootstrap - selected text incorrect if options have more than one space -


i have created bootstrap multiselect:

<div class="col-sm-4">                                     <div class="form-group">                                         <label for="providers" style="width:100%;">provider :</label>                                         <select id="providers" multiple="multiple" class="form-control">                                             @foreach (var providers in @viewbag.providers)                                             {                                                 <option value=@providers>@providers</option>                                             }                                         </select>                                         @html.hiddenfor(m => m.providerstring)                                     </div>                                 </div> 

the options in @viewbag.providers are: dr b, dr b c, dr p q, dr periciado

after selecting multiple values, shows "dr b" in selected textbox. removed spaces options value , works correctly not working values having multiple spaces.

did try putting quotes around option's value?

<option value="@providers">@providers</option>

instead of

<option value=@providers>@providers</option>


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -