FormFu / HTML-FormFu

HTML Form Creation, Rendering and Validation Framework. Just define the form, and let FormFu do the all heavy lifting.
http://formfu.rocks
34 stars 24 forks source link

error_container_attributes with error_attributes wont work #30

Closed Sadrak closed 5 years ago

Sadrak commented 9 years ago

I have a problem with using error_attributes. Changing in the same file error.attributes to self.error_attributes work, but then the behavior when a error_container_tag is set is broken. I don't get what is the problem there, but error_attributes and error_container_attributes won't work properly.

Example: error_attributes => { class => 'help-block', }, =>

<span>Error</span>

VS

error_container_tag => 'div', error_container_attributes => { class => 'test', }, error_attributes => { class => 'help-block', }, =>

<div class="help-block">
<span class="help-block">Error</span>
</div>
Sadrak commented 9 years ago

i guess this pull-request is not what you wanted. Still the commit with the closing tag is included.

If it is wrong, please close and i will try again.

Sadrak commented 9 years ago

Today i fall again over this trap.

i use twitter bootstrap and HTML::FormFu via default_args:

$form->default_args({
    elements => {
        Field => {
            error_tag => 'span',
            error_attributes => {
                class => 'control-label',
            },
            ...

This error_attributes is ignored. In HTML::FormFu::Role::Element::Field is a error_attributes, but in around render_data_non_recursive this is not used and later in _render_error_class is a switch for that case also missing.

djzort commented 9 years ago

Should this be a new ticket?

On 04/05/15 19:47, Felix Ostmann wrote:

Today i fall again over this trap.

i use twitter bootstrap and HTML::FormFu via default_args:

$form->default_args({ elements => { Field => { error_tag => 'span', error_attributes => { class => 'control-label', }, ...

This |error_attributes| is ignored. In |HTML::FormFu::Role::Element::Field| is a |error_attributes|, but in |around render_data_non_recursive| this is not used and later in |_render_error_class| is a switch for that case also missing.

— Reply to this email directly or view it on GitHub https://github.com/fireartist/HTML-FormFu/pull/30#issuecomment-98653951.

Sadrak commented 9 years ago

i thought this is a new & open ticket.

i opened this after your last message.

This only contains failing tests, not a solution.

fireartist commented 5 years ago

Thanks - this should be resolved now with 93bbdb9e9aca419bc1a42947d2046dd810df256a