Closed billmn closed 12 years ago
I noticed the same thing and ended up removing the auto_id_prefix by setting it to ''.
I also noticed a couple of other issues with the form output that I documented in Issue #758.
Hi Davide. I can't reproduce the issue. This code:
$form = Fieldset::forge();
$form->add('code', 'Code', array('type' => 'text'));
echo $form;
outputs:
<form action="http://fuelphp.tld/index.php/issues/751" accept-charset="utf-8" method="post">
<table>
<tr>
<td class=""><label for="form_code">Code</label></td>
<td class=""><input type="text" id="form_code" name="code" value="" /> </td>
</tr>
</table>
</form>
Could you give us some examples?
Actually I updated version and managed to reproduce this.
This issue is still present in the 1.1/develop branch as of today.
BTW, I was wondering what is the "meaning" of the $id parameter of the method label in the Form_Instance class. Since the 'id' key is unset from the attributes array, the label won't have any html id after the generation, and if it represents the id of the element the label is for, then there should'nt be any other treatment done on the variable.
Not sur I'm clear enough, so I'll provide some usecases :
1°
2°
3°
4°
5°
I hope my point of view is clearer now. IHMO, the $id parameter should be renamed $for or completly deleted and it should be used as is since we don't have any information which can be used to compute the name of the referenced element.
Closed, will be handled by issue #839.
I also have this problem. The prefix gets prepended twice to the for attribute of the label.
<label for="form_form_whatever">
and <input id="form_whatever">
I'm using fieldset class (but I think this is a problem of Form class) ... and I notice that labels have a wrong "for" attribute, the auto_id_prefix is double.