Levertine

Please login or register.

Author Topic: Custom field label nestiing wrong  (Read 1410 times)

TheDDude

  • Newbie
  • *
  • Posts: 21
  • Somebody familiar

Custom field label nestiing wrong
« on: January 15, 2015, 06:44:25 PM »
Code: [Select]
">
<dt>
<strong>Price (in USD):</strong> (required)
</dt>
<dd>
<label><input class="input_radio" tabindex="5" name="field_10" value="1" type="radio"> 0 - 9<br>
<label><input class="input_radio" tabindex="5" name="field_10" value="2" type="radio"> 10 - 19<br>
<label><input class="input_radio" tabindex="5" name="field_10" value="3" type="radio"> 20 - 29<br>
<label><input class="input_radio" tabindex="5" name="field_10" value="4" selected="selected" type="radio"> 30 - 39<br>
<label><input class="input_radio" tabindex="5" name="field_10" value="5" type="radio"> 40 - 49<br>
</label></label></label></label></label></dd>
The dream is dangerous.

Arantor

  • Levertine Developer
  • Full Member
  • *
  • Posts: 248

Re: Custom field label nestiing wrong
« Reply #1 on: January 15, 2015, 06:53:43 PM »
Oops, thanks.

I'll roll this into 1.1, which will be in the next few days (rolling releases ahoy!) but meantime, levgal_src/Model/Custom.php

Code: (find) [Select]
echo '
<label><input type="radio" class="input_radio" tabindex="', $context['tabindex'], '" name="field_', $id_field, '" value="', ($key + 1), '"', $option == $field['value'] ? ' selected="selected"' : '', ' /> ', $bbc ? parse_bbc($option) : $option, '<br />';

Code: (replace) [Select]
echo '
<label><input type="radio" class="input_radio" tabindex="', $context['tabindex'], '" name="field_', $id_field, '" value="', ($key + 1), '"', $option == $field['value'] ? ' selected="selected"' : '', ' /> ', $bbc ? parse_bbc($option) : $option, '</label><br />';

(There's no end tag on the label element, so the browser just fixes it in the DOM by the time it absolutely must (which is at the point of the dd tag, when it switches from inline to block closure)

Arantor

  • Levertine Developer
  • Full Member
  • *
  • Posts: 248

Re: Custom field label nestiing wrong
« Reply #2 on: January 17, 2015, 06:53:09 PM »
As 1.1 is now out, I'll move this to resolved.
 

SMF 2.0.9 | SMF © 2014, Simple Machines
BlueLight design by Bloc