zucchi/ZucchiBootstrap

Form button text disappears

Closed this issue · 1 comments

I have one form with a collection
In this collection there are 2 buttons, one submit and one reset

If i try to send a form and it is not valid, then the reset button has no value and this leads to a blank and very small button
button

HI Alampr,

This is because the reset button is being treated as an input an on post php recieves a null value. Then when you set the data on your for for validation it sets the value for reset as null. The way around this is to use the Zucchi\Form\Element\Reset class:

$actions->add(array(
        'name' => 'reset',
        'type' => 'Zucchi\Form\Element\Reset',
        'attributes' => array(
            'class' => 'btn',
        ),
        'options' => array(
            'bootstrap' => array(
                'style' => 'inline',
            ),
        ),
    ));