Results 1 to 7 of 7

Thread: HowTo Add a class to a label in a form

  1. #1
    User
    Join Date
    03-06-10.
    Posts
    54

    Default HowTo Add a class to a label in a form

    Hello community,

    i want to make some changes in my form,
    what i want to do is add a class to my label in a form.

    look at the code below. (thiss is original)

    Code:
    <label for="ctrl_1" class="mandatory"><span class="invisible">Mandatory field</span> Naam<span class="mandatory">*</span></label>
    Code:
    <label for="ctrl_1">Naam</label>

    this is wat i want it to be :
    Code:
    <label for="ctrl_1" class="mandatory extra_class"><span class="invisible">Mandatory field</span> Naam<span class="mandatory">*</span></label>
    Code:
    <label for="ctrl_1" class="extra_class" >Naam</label>
    is there a way to do this?

    much thanks Tieme

  2. #2
    User
    Join Date
    06-19-09.
    Posts
    328

    Default Re: HowTo Add a class to a label in a form

    in the form field configuration under "expert settings" there is a "css class" field

    http://goo.gl/OQ8He
    Consulenza Contao CMS https://www.intco.it

  3. #3
    User
    Join Date
    03-06-10.
    Posts
    54

    Default Re: HowTo Add a class to a label in a form

    Quote Originally Posted by ga.n
    in the form field configuration under "expert settings" there is a "css class" field

    http://goo.gl/OQ8He
    thanks for the reply,
    i only have one problem when i do that.
    that is that there is not only at label a extra_class but at input also.
    and i dont want to add a class to input.

    so anyone does anyone know where i can find the file's i need to edith to do this?

    much thanks.

    Tieme

  4. #4
    User
    Join Date
    06-19-09.
    Posts
    328

    Default Re: HowTo Add a class to a label in a form

    Quote Originally Posted by Tieme
    Quote Originally Posted by ga.n
    in the form field configuration under "expert settings" there is a "css class" field

    http://goo.gl/OQ8He
    thanks for the reply,
    i only have one problem when i do that.
    that is that there is not only at label a extra_class but at input also.
    and i dont want to add a class to input.

    so anyone does anyone know where i can find the file's i need to edith to do this?

    much thanks.
    Tieme
    why do not you just solve the problem through css?

    you can use "label.extra_class" instead of ".extra_class" as selector so the input will not be affected ;-)
    Consulenza Contao CMS https://www.intco.it

  5. #5
    User
    Join Date
    03-06-10.
    Posts
    54

    Default Re: HowTo Add a class to a label in a form

    oke that problem is solved,

    sorry i was totaly forgot that css function ops:

    but than i have a nother question only this is not CSS but HTML format of the Form,

    is thare a way to replace
    Code:
    value="some text"
    with
    Code:
    placeholder="some text"
    or is ther a simple way to add this to de form?

    much thanks.

    Tieme

  6. #6
    User
    Join Date
    03-06-10.
    Posts
    54

    Default Re: HowTo Add a class to a label in a form

    problem solved,

    there's a extention calld cleardefault i'v installd that and problem is solved.,

  7. #7

    Default Re: HowTo Add a class to a label in a form

    You can style label like that
    label[for="ctrl_1"]{
    css
    }

    It's not dynamic way, but is a way
    Web design agency - EDsolution.si Izdelava spletnih strani

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •