3
|
I am creating login page using bootstrap, here is my code
I want to make radio button field as required field . any idea how to do it.? |
||||||||
|
5
|
I got it! All you need to do is -create two divs, one for data-toggle and child her with btn-group Therefore, you get a group of buttons with a radio inside. set those radio btns to
It's working on bootstrap3 |
||||||||
|
5
|
In order to make input required, the element must be an input element. Change your buttons to inputs, give them a name, add required, and change the type to 'radio', and required should work (see this fiddle):
Unfortunately this means they don't look like cool buttons anymore. You can style radio buttons to look like what you want, and required will still stop the form from submitting, but you won't see the popup warning to select an option (see this fiddle). So, for what you want, it looks like you'll have to do some basic programming. Here's a fiddle with a basic check in place using your original buttons. |
||||||||||||
|