Reputation: 12945
I am trying to style a submit button for a form in Laravel 4. However, when I try the following, I get the same old boring default button:
{{Form::submit('Submit', null, array(
'type' => 'button',
'class' => 'btn btn-large btn-primary openbutton',
));}}
Is there a special way to style this type of button in a form context? Thank you.
Upvotes: 8
Views: 24223
Reputation: 3227
Try something like this...
{{ Form::submit('Submit', array('class' => 'primary')), Form::reset('Clear', array('class' => 'secondary')) }}
Then in your css...
form input[type="submit"], form input[type="reset"] {
-moz-border-radius: 5px;
-webkit-border-radius: 5px; border-collapse: separate !important;
border-radius: 5px;
}
form input.primary[type="submit"] {
clear: both;
margin: 20px 10px 0px 10px;
padding: 0px;
border: 0px;
width: 125px;
height: 31px;
background-color: #333333;
text-align: center;
line-height: 31px;
color: #FFFFFF;
font-size: 11px;
font-weight: bold;
}
form input.secondary[type="reset"] {
clear: both;
margin: 20px 10px 0px 10px;
padding: 0px;
border: 0px;
width: 125px;
height: 31px;
background-color: #555555;
text-align: center;
line-height: 31px;
color: #FFFFFF;
font-size: 11px;
font-weight: bold;
}
I hope this helps...
Upvotes: 0
Reputation: 508
Try removing 'null' before the options array
{{Form::submit('Submit', ['class' => 'btn btn-large btn-primary openbutton'])}}
If you are just looking for a normal html element try
{{Form::button('Open Image', ['class' => 'btn btn-large btn-primary openbutton'])}}
Upvotes: 17