2013-07-10 6 views
5

Sto cercando per lo stile di un pulsante di invio per un modulo in laravel 4. Tuttavia, quando provo quanto segue, ho la stessa vecchia noiosa pulsante di default:Styling un pulsante di invio per un form in laravel 4

{{Form::submit('Submit', null, array(
'type' => 'button', 
'class' => 'btn btn-large btn-primary openbutton', 
));}} 

Esiste un modo speciale per applicare questo tipo di pulsante in un contesto di modulo? Grazie.

+0

http://stackoverflow.com/questions/17284985/how-to-add-classes-to-larvel-4-forms/17286473#17286473 –

risposta

15

Provare a rimuovere 'null' prima che l'array opzioni

{{Form::submit('Submit', ['class' => 'btn btn-large btn-primary openbutton'])}} 

Se siete solo in cerca di un normale elemento HTML provare

{{Form::button('Open Image', ['class' => 'btn btn-large btn-primary openbutton'])}} 
+0

, purtroppo, che non l'ha fatto lavoro – user1072337

+1

Dovrebbe funzionare, io uso 'Form :: submit ('Vai', array ('classe' => 'btn'))' e funziona bene. – user2094178

+0

hmm, beh, non funziona per me. Qualche idea su cosa potrebbe succedere? – user1072337

0

provare qualcosa di simile ...

{{ Form::submit('Submit', array('class' => 'primary')), Form::reset('Clear', array('class' => 'secondary')) }} 

Quindi nel tuo 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; 
} 

Spero che questo aiuta ...

Problemi correlati