Menu

#67 Make radio-buttons and check-boxes themeable

Core Class
closed-fixed
nobody
Display (31)
5
2006-03-13
2005-05-26
rck
No

Motivation: Checkboxes and Radiobuttons get an ugly
border, if one sets the background-colour of
input-elements. On the other hand, textboxes and submit
buttons can benefit from that. A couple of browsers
don't support the needed selectors to address them
directly, so why not introduce classes to do so?

As most modules rely on the PWS Form-classes to get the
job done, only two changes in core/Form.php are needed:

formRadio():

70 $radio = "<input type=\"radio\"
name=\"$name\" value=\"$value\" ";
71
becomes

70 $radio = "<input type=\"radio\"
name=\"$name\" value=\"$value\" class=\"rb\" ";
71

and

formCheckBox():

263 $checkbox = "<input type=\"checkbox\"
name=\"$name\" value=\"$value\" ";

becomes

263 $checkbox = "<input type=\"checkbox\"
name=\"$name\" value=\"$value\" class=\"cb\" ";

...to use that in your theme, add something like this
in the <head> section of your theme.tpl:

<style>
.rb, .cb {
background-color: transparent;
}
</style>

Discussion

  • Michael H. Rasmussen

    Logged In: YES
    user_id=1126375

    I have added your suggestion to EZelement, and checkboxes
    and radio buttons will now have a class by default. I have
    decided to change the class names, and use "checkbox" for
    checkboxes and "radio" for radio buttons.

    Some modules do not use EZforms and I will add the classes
    manually.

    Your request has been added to CVS. Look for it in the next
    release of phpWebSite (0.10.3).

    - Michael (TechElephant)

     
  • Kenneth Poulsen

    Kenneth Poulsen - 2006-03-13
    • status: open --> closed-fixed
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.