Results 1 to 5 of 5

Thread: form field - grey out

  1. #1
    New user
    Join Date
    03-04-11.
    Posts
    10

    Default form field - grey out

    Hi,

    I wan't to grey a form field out, when there is no remaning spaces (0 free). I thought the code below would work - but it seems like i can't have more then one »%s« in my label. Do any of you know another way to do this?

    $GLOBALS['TL_LANG']['MSC']['countFree'] = ' <span id="%s_tabel"> (%s free) </span>';


    /Morten

  2. #2
    Experienced user
    Join Date
    06-11-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: form field - grey out

    Because formauto has to sit ontop of the existing form system, there was the limit to which this could be extended. However, you cannot book for something that has 0 values, as it will generate and error and prevent booking. The label of the field can be extended using the code you have, however that is only the text inside the HTML form control, not the actual form control.

  3. #3
    New user
    Join Date
    03-04-11.
    Posts
    10

    Default Re: form field - grey out

    Thanks for the quick reply!
    Do you know if there is a way to apply the »id="%s_tabel« to the form field instead of using the label for it?


    /Morten

  4. #4
    Experienced user
    Join Date
    06-11-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: form field - grey out

    the countrfree string only accepts the digit of how many seats are free...

    to add a dynamic id, you will to intercept the form field renderer, e.g. you will have to write a form hook (which loads the form widget) or you if you need add a static class, you can simply edit the form in the form generator and add a class there. Not sure why you need to change the ID, because all form IDs will always be unique. Best to use a class instead, and change the form widget template.

  5. #5
    New user
    Join Date
    03-04-11.
    Posts
    10

    Default Re: form field - grey out

    Okay! I made the %s into a javascript var and called it 2 times. I know it's a hack but i works (if you got java enabled).

    / Morten

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
  •