CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions »
  • Usability Improvements (Moderator: Dave Greenberg) »
  • Custom field css id, can't we let the number out?
Pages: [1]

Author Topic: Custom field css id, can't we let the number out?  (Read 1732 times)

Jeroen~

  • I’m new here
  • *
  • Posts: 25
  • Karma: 1
    • WoesteLand
  • CiviCRM version: CiviCRM 4.2
  • CMS version: Drupal 7
Custom field css id, can't we let the number out?
November 09, 2012, 12:43:42 pm
When I add custom field groups to my events they get an id in the page html with the name of the field and a random? number.
For example, I have a fieldgroup with the name "extra information" in the source of the outputted page it is called id="Extra_information__56".
The problem for me is that the number isn't always the same number.
On every event I create, the number can be different.

When I want to do something with the table the event group like hiding the table in the page, I have to add a line in my CSS file for every number that is used. Which is pretty annoying because I have a list of 40 identical lines in my css now because I don't want the table visible in my events (I use the information to show icons).

Does anybody recognize this problem?
I don't see the point for the numbers behind the name, can't we just let them out in a future CIVICRM update?

You can see what I mean with the icons on the website I use it on: http://www.woesteland.nl/civicrm/event/info?reset=1&id=69 (live website so don't register please)

demeritcowboy

  • Ask me questions
  • ****
  • Posts: 570
  • Karma: 42
  • CiviCRM version: Always the latest!
  • CMS version: Drupal 6 mostly, still evaluating 7.
  • MySQL version: Mix of 5.0 / 5.1 / 5.5
  • PHP version: 5.3, usually on Windows
Re: Custom field css id, can't we let the number out?
November 11, 2012, 11:59:32 am
Try the css prefix selector, e.g. for an input text field:

input[id^="Extra_information__"]

I can't remember if it's jquery-specific, but if so just use some javascript in an extra.tpl:
cj('input[id^="Extra_information__"]').css( ... )

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions »
  • Usability Improvements (Moderator: Dave Greenberg) »
  • Custom field css id, can't we let the number out?

This forum was archived on 2017-11-26.