Maybe the copy type could be changed to have an id too? Something like:
public function create_copy($params)
{
$params = $this->normalize_params($params);
$id = isset($params['id']) ? ' id="'.$params['id'].'"' : '';
$copy = $this->simple_field_value($params);
$tag = (empty($params['tag'])) ? $this->copy_tag : $params['tag'];
return '<'.$tag.$id.'>'.$copy.'</'.$tag.'>';
}
As an FYI, with regards to the fieldsets, if you are using the class of "tab", it will automatically overwrite the ID value for the fieldset to be fieldset{i} where {i} is the tab index number.
Well I am using the fieldset id's to enable easytabs (jquery library) - although in a front end situation, not admin, so that's a germane comment.
The fieldset and section types are really helping layout the forms I use now - don't know why I didn't use them earlier. And of course the id attributes help too!
Comments
The Form class fieldset_open() has id as the 3rd argument, so I used that option. I clarified the line numbers above.
public function create_copy($params) { $params = $this->normalize_params($params); $id = isset($params['id']) ? ' id="'.$params['id'].'"' : ''; $copy = $this->simple_field_value($params); $tag = (empty($params['tag'])) ? $this->copy_tag : $params['tag']; return '<'.$tag.$id.'>'.$copy.'</'.$tag.'>'; }
The fieldset and section types are really helping layout the forms I use now - don't know why I didn't use them earlier. And of course the id attributes help too!
That's a useful tip though, thanks.