We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Unnecessary margin div generated for multiple fields when they're hidden

Developer Preview

Low's avatar
Low
407 posts
7 years ago
Low's avatar Low

When I generate a form field like so:

$sections[0][] = array(
 'title' => 'set_label',
 'desc' => 'set_label_help',
 'fields' => array(
  'set_id' => array(
   'type' => 'hidden',
   'value' => $set_id
  ),
  'set_label' => array(
   'required' => TRUE,
   'type' => 'text',
   'value' => $set['set_label']
  )
 )
);

…I get a div.add-mrg-top around the second input field, resulting in unnecessary spacing. The div shouldn’t be added when there’s hidden fields there.

       
Derek Jones's avatar
Derek Jones
7,561 posts
7 years ago
Derek Jones's avatar Derek Jones

Confirmed and fixed, thanks Low, the next build will only add that margin for visible sequential fields. If you want to patch yours up now so you can be sure your forms are rendering properly, open system/ee/EllisLab/ExpressionEngine/View/_shared/form/fieldset.php and replace the $count++ on line 130 with:

if ($field['type'] != 'hidden')
{
    $count++;
}
       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.