filter dosent work radio button field with span tag

filter dosent work radio button field with span tag

by Çağlar MERSİNLİ -
Number of replies: 5
i use radio button field with span tag 

 example radio button 's options


in this case  filter dosent work 

but same case filter works for checkbox field 

so i want to radio button field . how can i do?


Average of ratings: -
In reply to Çağlar MERSİNLİ

Re: filter dosent work radio button field with span tag

by Itamar Tzadok -

Have you tried filtering by the whole string (including the html)?

Altenately you can try wrapping the field value in the template rather than in the field options. For instance, suppose the field name is Status and the options:

Bitti
Eksik
Bitmedi

In the entry template you can put:

<span class="label label-[[!Status] ]">[[Status] ]</span>

and in the css template:

.label-Bitti {
background-color: green;
}
.label-Eksik {
background-color: yellow;
}
.label-Bitmedi {
background-color: red;
}

or whatever styles that suit the purpose.

hth smile

Average of ratings: Useful (1)
In reply to Itamar Tzadok

Ynt: Re: filter dosent work radio button field with span tag

by Çağlar MERSİNLİ -

Hi Itamar;

yes i  tried filtering by the whole string (including the html)

i see when i look page source 

in radio button field


in checkbox field



I think  both the same;

checkbox works but radio button dosent work ?

In reply to Çağlar MERSİNLİ

Re: Ynt: Re: filter dosent work radio button field with span tag

by Itamar Tzadok -

The filter works on what you put in the options list, not the dom.

It is possible that the filter works on checkbox but not radio. It's not the same code.

At any rate, the field was not designed to handle html in the option list. Accordingly, if you put html there some things, such as the filter may or may not work.

Please try the alternate approach.

smile

Average of ratings: Useful (1)
In reply to Itamar Tzadok

Ynt: Re: Ynt: Re: filter dosent work radio button field with span tag

by Çağlar MERSİNLİ -

ok i see;

i tried the alternate approach. but It did not work. i think  bootstrap  label tag  overlaps   mine



this is mine




In reply to Çağlar MERSİNLİ

Ynt: Re: Ynt: Re: filter dosent work radio button field with span tag

by Çağlar MERSİNLİ -

ok i got it 

i use this css code  and  done


.label-Yapılmadı, .badge-Yapılmadı {
    background-color: #b94a48;
}
.label-Eksik, .badge-Eksik {
    background-color: #f89406;
}
.label-Yapıldı, .badge-Yapıldı {
    background-color: #468847;
}