Use label tags in checkbox descriptions.
[readifood.git] / lib / functions.php
index 2fcbe0e..eb48c4b 100644 (file)
 
   function show_role_form($role, $roles) {
     for ($i = 0; $i < count($roles); $i++) {
-      echo " <input type=\"checkbox\" name=\"role_$i\"";
+      echo " <input type=\"checkbox\" id=\"role_$i\" name=\"role_$i\"";
       if ($role & (1 << $i)) echo " checked";
-      echo ">$roles[$i]\n";
+      echo "><label for=\"role_$i\">$roles[$i]</label>\n";
     }
   }