Welcome Guest, Not a member yet? Register   Sign In
Nested Fieldsets?
#1

[eluser]Unknown[/eluser]
Take a look at this code:

Code:
<div>
&lt;?= form_open('outreach/save_visitor'); ?&gt;

  &lt;?= form_fieldset('Personal') ?&gt;
   &lt;?= form_fieldset('Name') ?&gt;
    <div>
     &lt;?= form_label('First Name','first') ?&gt;
     &lt;?= form_input('first','','id="first"') ?&gt;
     &lt;?= form_error('first') ?&gt;
    </div>
    <div>
     &lt;?= form_label('Last Name','last') ?&gt;
     &lt;?= form_input('last','','id="last"') ?&gt;
     &lt;?= form_error('last') ?&gt;
    </div>
   &lt;?= form_fieldset_close() ?&gt;
   <div>
    &lt;?= form_label('Age Bracket (visitor)','visitor_age') ?&gt;
    &lt;?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',
     );
    ?&gt;
    &lt;?= form_dropdown('visitor_age',$ages,'id="visitor_age"') ?&gt;
   </div>
  &lt;?= form_fieldset_close() ?&gt;

  &lt;?= form_fieldset('Gender') ?&gt;
   &lt;?= form_error('gender') ?&gt;
   <div>
    &lt;?= form_label('Female','gender_female') ?&gt;
    &lt;?= form_radio('gender','',TRUE,'id="gender_female"') ?&gt;
   </div>
   <div>
    &lt;?= form_label('Male','gender_male') ?&gt;
    &lt;?= form_radio('gender','',FALSE,'id="gender_male"') ?&gt;
   </div>
  &lt;?= form_fieldset_close() ?&gt;

  &lt;?= form_fieldset('Contact') ?&gt;
   <div>
    &lt;?= form_label('Email','email') ?&gt;
    &lt;?= form_input('email','','id="email"') ?&gt;
   </div>
   <div>
    &lt;?= form_label('Address 1','address1') ?&gt;
    &lt;?= form_input('address1','','id="address1"') ?&gt;
   </div>
   <div>
    &lt;?= form_label('Address 2','address2') ?&gt;
    &lt;?= form_input('address2','','id="address2"') ?&gt;
   </div>
   <div>
    &lt;?= form_label('State','state') ?&gt;
    &lt;?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',
     );
    ?&gt;
    &lt;?= form_dropdown('state',$states,'id="state"') ?&gt;
   </div>
   <div>
    &lt;?= form_label('City','city') ?&gt;
    &lt;?= form_input('city','','id="city"') ?&gt;
   </div>
   <div>
    &lt;?= form_label('Zip Code','zip') ?&gt;
    &lt;?= form_input('zip','','id="zip"') ?&gt;
   </div>
   <div>
    &lt;?= form_label('Home Phone','home_phone') ?&gt;
    &lt;?= form_input('home_phone','','id="home_phone"') ?&gt;
    &lt;?= form_error('home_phone') ?&gt;
   </div>
   <div>
    &lt;?= form_label('Cell Phone','cell_phone') ?&gt;
    &lt;?= form_input('cell_phone','','id="cell_phone"') ?&gt;
    &lt;?= form_error('cell_phone') ?&gt;
   </div>
   <div>
    &lt;?= form_label('Work Phone','work_phone') ?&gt;
    &lt;?= form_input('work_phone','','id="work_phone"') ?&gt;
    &lt;?= form_error('work_phone') ?&gt;
   </div>
  &lt;?= form_fieldset_close() ?&gt;
  &lt;?= form_fieldset('Family') ?&gt;
   <div>
    &lt;?= form_label('Spouse (first name)','spouse_name') ?&gt;
    &lt;?= form_input('spouse_name','','id="spouse_name"') ?&gt;
   </div>
   <div>
    &lt;?= form_label('Child #1 (first name)','child1_name') ?&gt;
    &lt;?= form_input('child1_name','','id="child1_name"') ?&gt;
    &lt;?= form_input('child1_bday','Birth Date','id="child1_bday"') ?&gt;
   </div>
   <div>
    &lt;?= form_label('Child #2 (first name)','child2_name') ?&gt;
    &lt;?= form_input('child2_name','','id="child2_name"') ?&gt;
    &lt;?= form_input('child2_bday','Birth Date','id="child2_bday"') ?&gt;
   </div>
   <div>
    &lt;?= form_label('Child #3 (first name)','child3_name') ?&gt;
    &lt;?= form_input('child3_name','','id="child3_name"') ?&gt;
    &lt;?= form_input('child3_bday','Birth Date','id="child3_bday"') ?&gt;
   </div>
   <div>
    &lt;?= form_label('Child #4 (first name)','child4_name') ?&gt;
    &lt;?= form_input('child4_name','','id="child4_name"') ?&gt;
    &lt;?= form_input('child4_bday','Birth Date','id="child4_bday"') ?&gt;
   </div>
  &lt;?= form_fieldset_close() ?&gt;

  &lt;?= form_submit('submit', 'Submit') ?&gt;

&lt;?= form_close() ?&gt;
</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?




Theme © iAndrew 2016 - Forum software by © MyBB