Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Possible invalid id of checkboxes in MailForm

#72

In MF_Widget_Checkbox, checkbox value shoud be separated from label. Actually, if you specify a value with many words in settings.php file, it results into an invalid id. (In fact, checkbox get to id fields, one from the name, and one from the value... this is an other bug)

Separating value from label would also allow translating the label.

I propose to set value like this:

[mycheckbox]

type = checkbox

value 1 = yes, String to identify yes

value 2 = no, String to identify no

Reported by Charles Brunet · November 12th, 2008 @ 02:23 PM

State: resolved
Milestone: 5.0.3
Assigned to: Charles Brunet Charles Brunet

Activity

  1. Charles Brunet
    Charles Brunet
    • Assigned user changed from lux to Charles Brunet
    • State changed from new to open

    We actually can specify a different key from label, using setValues like that:

    setValues = "eval: array ('key1'=>'label 1', 'key2'=>'label 2')"

    What should be done would be to convert invalid keys into valid ones to prevent invalid xhtml.

    July 29th, 2009 @ 03:27 PM

  2. Charles Brunet
    Charles Brunet
    • State changed from open to resolved
    • Milestone set to 5.0.3

    Another way is to use the syntax:

    value[] = A first value
    value[] = A second value
    value[] = A third value
    default_value = 0,2
    

    I did some corrections to ease translation of checkboxes ans to generate more valid xhtml (ids were duplicated...)

    It is still possible to create invalid checkbox values, but there are ways to avoid that.

    August 7th, 2009 @ 02:50 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.