Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 67469

HTML form with horizontally expanded select options

$
0
0

I would like to write an HTML form with a short select field with the following features:

  • All options are visible. That can be easily achieved with "size" = number of items.
  • Those items should be displayed explicitly next to the label (on the right), as if they were switchable buttons.

If the code is something like this...

<div class="row">
        <label for="myvar">Chose an option:</label>
        <select class="form-control" id="myvar" name="myvar" size="5">
            <option value="" selected="selected">
            <option value="0" class="text-primary">Yes</option>
            <option value="1" class="text-warning">No</option>
            <option value="2" class="text-mutted">Sometimes</option>
        </select>
    </div>

I would like to have something like:

Chose an option: YesNoSometimes

Basically, having the select options expanded horizontally to the right and visible.


Viewing all articles
Browse latest Browse all 67469

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>