I have a form with several radio-type inputs (only one can be selected).
The code is as follows:
<div class="form-group">
<label><strong>Visible</strong></label><br>
@if ($employee->public==1)
<p style="display:inline;"></p><input type="radio" name="public" value="1" class="visible" checked>
<p style="display:inline;"></p><input type="radio" name="public" value="0" class="novisible">
@elseif ($employee->public==0)
<p style="display:inline;"></p><input type="radio" name="public" value="1" class="visible">
<p style="display:inline;"></p><input type="radio" name="public" value="0" class="novisible" checked>
@endif
</div>
It is a form to indicate if the 'data' is visible or not.
The view looks like this, if it is selected that is NOT visible:
If it is selected that IS is visible:
The CSS is the following:
input[type=radio]{
&.visible{
-webkit-appearance: none;
-moz-appearance: none;
-o-appearance: none;
height: 30px;
width: 60px;
background: grey;
border-radius: 10px;
margin: 0px;
}
&.visible:checked{
background: #5cb85c;
}
}
input[type=radio]{
&.novisible{
-webkit-appearance: none;
-moz-appearance: none;
-o-appearance: none;
height: 30px;
width: 60px;
background: grey;
border-radius:10px;
margin:0px;
}
&.novisible:checked{
background: #d9534f;
}
}
Is there any possible way to put a text to the input? Maybe the best option is to make bootstrap buttons and 'make them type radio'?
Thank you.