Form builder fieldsets

edited December 2013 in Feature Requests
Would it be possible to assign id attributes to the fieldset type of form builder - or the section type?

The form class method fieldset_open() seems to imply it? In Form builder it just needs this in the create_fieldset():

... $id = isset($params['id']) ? $params['id'] : ''; // line 2646 ... $this->form->fieldset_open($legend, $attrs, $id); // line 2656

Comments

  • edited 3:13PM
    Sure... sounds like you just need 'id' => $params['id'] added to it around line 2644 correct?
  • edited December 2013
    Kind of - if id is set (hence the isset())

    The Form class fieldset_open() has id as the 3rd argument, so I used that option. I clarified the line numbers above.
  • edited December 2013
    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.'>'; }
  • edited 3:13PM
    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.
  • edited 3:13PM
    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!

    That's a useful tip though, thanks.
Sign In or Register to comment.