Page 1 of 1

name and id in class.module.inc.php

Posted: Sat Apr 08, 2006 2:45 pm
by nils73
There seems to be a problem with class.module.inc.php which is closely related to accessibility but I guess it matches this topic (Quality Assurance) bests. When coding standards compliant websites you need to specify a label for each form-field, i.e.

Code: Select all


<label for="c4input_name">First Name:
  <input type="text" id="c4input_name" />
</label>

At present there is only an attribute for name, but none for id. When I modify class.module.inc.php to display both values, I get a lot of problems in admin-mode, i.e. some fields won't update anymore. Does anyone know a workaround for me, except for creating my own module-instances for fields?

Regards,
Nils

Re: name and id in class.module.inc.php

Posted: Sat Apr 08, 2006 2:54 pm
by Ted
The best way to handle this would be to have a module api method to create a label.  That way it would take the id into account also.  Though, honestly, I'm not sure how that could happen with the input being inside the label.  I thought they were exclusive.

Re: name and id in class.module.inc.php

Posted: Sat Apr 08, 2006 3:07 pm
by nils73
There are two ways to handle fields and labels. One is to put label before input, second (and best for accessibility) is to have the label-tag around the field-tag. But this should be up to the coder because sometimes you can't do the one thing and have to go with the other.

I already thought that this might get difficult ... so I will code my own module-instances ... knowing that this makes me cry when it comes to updates.

Regards,
Nils