EllisLab text mark
Advanced Search
     
Nested Fieldsets?
Posted: 24 October 2011 12:04 PM
Joined: 2011-10-21
27 posts

Take a look at this code:

<div>
 
<?form_open('outreach/save_visitor'); ?>

  <?
form_fieldset('Personal'?>
   <?
form_fieldset('Name'?>
    
<div>
     
<?form_label('First Name','first'?>
     <?
form_input('first','','id="first"'?>
     <?
form_error('first'?>
    
</div>
    <
div>
     
<?form_label('Last Name','last'?>
     <?
form_input('last','','id="last"'?>
     <?
form_error('last'?>
    
</div>
   
<?form_fieldset_close() ?>
   
<div>
    
<?form_label('Age Bracket (visitor)','visitor_age'?>
    <?php
     $ages 
= array(
      
'13to15' => '13 to 15',
      
'16to25' => '16 to 25',
      
'26to35' => '26 to 35',
      
'36to45' => '36 to 45',
      
'46to55' => '46 to 55',
      
'56to65' => '56 to 65',
      
'66plus' => '66 or older',
     );
    
?>
    <?
form_dropdown('visitor_age',$ages,'id="visitor_age"'?>
   
</div>
  
<?form_fieldset_close() ?>
 
  <?
form_fieldset('Gender'?>
   <?
form_error('gender'?>
   
<div>
    
<?form_label('Female','gender_female'?>
    <?
form_radio('gender','',TRUE,'id="gender_female"'?>
   
</div>
   <
div>
    
<?form_label('Male','gender_male'?>
    <?
form_radio('gender','',FALSE,'id="gender_male"'?>
   
</div>
  
<?form_fieldset_close() ?>

  <?
form_fieldset('Contact'?>
   
<div>
    
<?form_label('Email','email'?>
    <?
form_input('email','','id="email"'?>
   
</div>
   <
div>
    
<?form_label('Address 1','address1'?>
    <?
form_input('address1','','id="address1"'?>
   
</div>
   <
div>
    
<?form_label('Address 2','address2'?>
    <?
form_input('address2','','id="address2"'?>
   
</div>
   <
div>
    
<?form_label('State','state'?>
    <?php
     $states 
= array(
      
'AL' => 'Alabama',
      
'AK' => 'Alaska',
      
'AZ' => 'Arizona',
      
'AR' => 'Arkansas',
      
'CA' => 'California',
      
'CO' => 'Colorado',
      
'CT' => 'Connecticut',
      
'DE' => 'Delaware',
      
'DC' => 'District Of Columbia',
      
'FL' => 'Florida',
      
'GA' => 'Georgia',
      
'HI' => 'Hawaii',
      
'ID' => 'Idaho',
      
'IL' => 'Illinois',
      
'IN' => 'Indiana',
      
'IA' => 'Iowa',
      
'KS' => 'Kansas',
      
'KY' => 'Kentucky',
      
'LA' => 'Louisiana',
      
'ME' => 'Maine',
      
'MD' => 'Maryland',
      
'MA' => 'Massachusetts',
      
'MI' => 'Michigan',
      
'MN' => 'Minnesota',
      
'MS' => 'Mississippi',
      
'MO' => 'Missouri',
      
'MT' => 'Montana',
      
'NE' => 'Nebraska',
      
'NV' => 'Nevada',
      
'NH' => 'New Hampshire',
      
'NJ' => 'New Jersey',
      
'NM' => 'New Mexico',
      
'NY' => 'New York',
      
'NC' => 'North Carolina',
      
'ND' => 'North Dakota',
      
'OH' => 'Ohio',
      
'OK' => 'Oklahoma',
      
'OR' => 'Oregon',
      
'PA' => 'Pennsylvania',
      
'RI' => 'Rhode Island',
      
'SC' => 'South Carolina',
      
'SD' => 'South Dakota',
      
'TN' => 'Tennessee',
      
'TX' => 'Texas',
      
'UT' => 'Utah',
      
'VT' => 'Vermont',
      
'VA' => 'Virginia',
      
'WA' => 'Washington',
      
'WV' => 'West Virginia',
      
'WI' => 'Wisconsin',
      
'WY' => 'Wyoming',
     );
    
?>
    <?
form_dropdown('state',$states,'id="state"'?>
   
</div>
   <
div>
    
<?form_label('City','city'?>
    <?
form_input('city','','id="city"'?>
   
</div>
   <
div>
    
<?form_label('Zip Code','zip'?>
    <?
form_input('zip','','id="zip"'?>
   
</div>
   <
div>
    
<?form_label('Home Phone','home_phone'?>
    <?
form_input('home_phone','','id="home_phone"'?>
    <?
form_error('home_phone'?>
   
</div>
   <
div>
    
<?form_label('Cell Phone','cell_phone'?>
    <?
form_input('cell_phone','','id="cell_phone"'?>
    <?
form_error('cell_phone'?>
   
</div>
   <
div>
    
<?form_label('Work Phone','work_phone'?>
    <?
form_input('work_phone','','id="work_phone"'?>
    <?
form_error('work_phone'?>
   
</div>
  
<?form_fieldset_close() ?>
  <?
form_fieldset('Family'?>
   
<div>
    
<?form_label('Spouse (first name)','spouse_name'?>
    <?
form_input('spouse_name','','id="spouse_name"'?>
   
</div>
   <
div>
    
<?form_label('Child #1 (first name)','child1_name'?>
    <?
form_input('child1_name','','id="child1_name"'?>
    <?
form_input('child1_bday','Birth Date','id="child1_bday"'?>
   
</div>
   <
div>
    
<?form_label('Child #2 (first name)','child2_name'?>
    <?
form_input('child2_name','','id="child2_name"'?>
    <?
form_input('child2_bday','Birth Date','id="child2_bday"'?>
   
</div>
   <
div>
    
<?form_label('Child #3 (first name)','child3_name'?>
    <?
form_input('child3_name','','id="child3_name"'?>
    <?
form_input('child3_bday','Birth Date','id="child3_bday"'?>
   
</div>
   <
div>
    
<?form_label('Child #4 (first name)','child4_name'?>
    <?
form_input('child4_name','','id="child4_name"'?>
    <?
form_input('child4_bday','Birth Date','id="child4_bday"'?>
   
</div>
  
<?form_fieldset_close() ?>

  <?
form_submit('submit''Submit'?>

 <?
form_close() ?> 
</div

Give that a run, and notice how the fieldsets aren’t matching up correctly! I am fairly confident that this isn’t a problem on my side. Am I correct?

 
Posted: 24 October 2011 06:00 PM   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2011-03-25
220 posts

Don’t see the purpose of the fieldset around the name section, but it lines up for me. The Name fieldset is inside the personal one. All others are “parents” I’ll call them.

So maybe it’s a style on your side? screenshot?