mercredi 18 avril 2018

Can a dropdown menu with checkboxes be a required field?

This is the code I currently have:

<form class="form-horizontal" role="form" method="post" action="/success">
            <div class="btn-group">
                <button type="button" class="btn dropdown-toggle" data-toggle="dropdown" aria-haspopup="true"
                        aria-expanded="false" >
                    Modalities
                </button>
                <div class="dropdown-menu" >
                    <a class="dropdown-item"><input type="checkbox" name="dce" value="dce"> DCE</a>
                    <a class="dropdown-item"><input type="checkbox" name="dwi" value="dwi"> DWI</a>
                    <a class="dropdown-item"><input type="checkbox" name="perfusion" value="perfusion">
                        Perfusion</a>
                    <a class="dropdown-item"><input type="checkbox" name="ultrasound" value="ultrasound"> Ultrasound</a>
                    <a class="dropdown-item"><input type="checkbox" name="ct" value="ct"> CT</a>
                </div>
            </div>

There is a button which when pressed, opens up a dropdown menu with several checkbox, which I do not want to be unchecked. Can this be done with Bootstrap 4.0?




Aucun commentaire:

Enregistrer un commentaire