Yii Framework Forum: Checkboxlist - Inputs Inside Labels - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Checkboxlist - Inputs Inside Labels Rate Topic: -----

#1 User is offline   Lilt 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 53
  • Joined: 06-July 10

Posted 10 October 2012 - 09:33 AM

Hi,

I'd like to request the ability to add check-boxes inside labels. This is valid by the HTML spec and allows for labels & checkboxes to be kept inline, in containers without a fixed width, ensuring that the checkbox is always beside its label (assuming the label is display block or inline-block).

If the input is outside the label, the second element may be bumped to the next line. This could be done with another element around the pair, but when this is added for every checkbox this becomes tedious. Also, the extra element is not clickable to select the checkbox, while the label would be.

I think this could be done fairly easily with an htmlOptions flag (inputInLabel?) or with a special template item "{inputlabel}".

What do people think?
0

#2 User is offline   SaulBW 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 17-October 12
  • Location:Cape Town, South Africa

Posted 14 January 2013 - 09:23 PM

+1

I've been trying to get this right for an hour now. Seems I'll have to extend the class after all.
0

#3 User is offline   Mochamad Gufron 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 24-August 11
  • Location:Sidoarjo, Indonesia

Posted 04 June 2013 - 07:27 PM

i've got the same problem, then i see the code inside the framework, i found this way.
You can use this template instead.
 {beginLabel} {input} {labelTitle} {endLabel} 
.


Regards,
Mochamad Gufron Efendi


Junior Web Developer
- My Personal Sites -
0

#4 User is offline   nooneelse 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 08-July 13
  • Location:Brazil

Posted 19 July 2013 - 11:09 AM

Templates are awesome, but, where do I put this ? labelEx or checkBox ?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users