Why is Twitter Bootstrap 2 btn-group not working?
Is there a way to make it work? Here's my code (I use it in a table):
<div class="btn-group">
<td><a class="btn btn-mini btn-info" href="{{ URL::to('characters/{{ $player->name') }}">View</a></td>
<td>{{ Form::open(array('method' => 'DELETE', 'route' => array('players.destroy', $player->id))) }}
{{ Form::submit('Delete', array('class' => 'btn btn-mini btn-danger')) }}
{{ Form::close() }}</td>
</div>
0
source to share
1 answer
just type class="btn-group"
in the element <form>
:
Try something like this:
<td>
<div class="btn-group">
<a class="btn btn-mini btn-info" href="{{ URL::to('characters/{{ $player->name') }}">View</a>
{{ Form::open(array('class' => 'btn-group', 'method' => 'DELETE', 'route' => array('players.destroy', $player->id))) }}
{{ Form::submit('Delete', array('class' => 'btn btn-mini btn-danger')) }}
{{ Form::close() }}
</div>
</td>
your HTML at the end should look something like this: http://jsfiddle.net/hyWnt/1/
Updated jsfiddle for Bootstrap 2.3.2: http://jsfiddle.net/msturdy/HyfKZ/4/
changes:
New CSS:
div.btn-group + form.btn-group {
margin-left: -5px;
display:inline;
}
And then the code should be:
<td>
<div class="btn-group">
<div class="btn-group">
<a href="{{ URL::to('characters/'. $player->name) }}" class="btn btn-mini btn-info">View</a>
<span class="btn" style="display:none"></span>
</div>
<form method="POST" action="http://localhost:8000/account/management/characters/delete/23" accept-charset="UTF-8" class="btn-group">
<input name="_token" type="hidden" value="7GKfarNh81RKu1Y5Dts8bYeFjOG7i8bLdD0CdNLa">
<input name="_method" type="hidden" value="DELETE">
<input class="btn btn-mini btn-danger" type="submit" value="Delete">
</form>
</div>
</td>
+1
source to share