Answers.Body: <p>CiviCRM uses civicrm_price_set.name to generate class. I believe this field in never updated on Update mode. It is updated when we explicitly set them using api or mysql query.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-04T18:23:52.180Z
Answers.Text: I tested it on 5.6.alpha1 and it does not change now.
Answers.UserDisplayName: Zachary
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-30T22:20:55.750Z
Answers.LastActivityDate: 2018-07-30T22:20:55.750Z
Answers.UserDisplayName: Pradeep Nayak
Answers.Body: <p>I'm not sure how much the price fields name will change but perhaps you can use some 'wildcard' attribute selectors? (contains, starts with etc.)</p>
  
  <p><a href="http://api.jquery.com/category/selectors/attribute-selectors/" rel="nofollow noreferrer">http://api.jquery.com/category/selectors/attribute-selectors/</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-03T01:52:19.427Z
Answers.LastActivityDate: 2018-08-03T01:52:19.427Z
Answers.UserDisplayName: RayWright
Body: <p>For instance, if my price field is called Main Conference (Before 7/31), the CSS class it gets is: "main_conference_before_7_31_-content"</p>
  
  <p>If I change the title of the price set, the CSS class changes.</p>
  
  <p>When modifying the form with jQuery, we rely on the CSS class to make adjustments like .prependTo (etc.). Perhaps this is not the most ideal way to do it, but it's worked in a pinch.</p>
  
  <p>How difficult would it be to make an extension to make the price set field class fixed, or even user-adjustable? Or, to set a class and ID for each one? </p>
  
  <p>Civi 4.7 or 5.x </p>
  
Tags: <price-sets>
Title: Why does the price set field title change the CSS class?
ThreadText: # Why does the price set field title change the CSS class?
  
  (Asked by: username_0 on 2018-07-30)
  
  For instance, if my price field is called Main Conference (Before 7/31), the CSS class it gets is: "main\_conference\_before\_7\_31\_-content"
  
  If I change the title of the price set, the CSS class changes.
  
  When modifying the form with jQuery, we rely on the CSS class to make adjustments like .prependTo (etc.). Perhaps this is not the most ideal way to do it, but it's worked in a pinch.
  
  How difficult would it be to make an extension to make the price set field class fixed, or even user-adjustable? Or, to set a class and ID for each one?
  
  Civi 4.7 or 5.x
  
  **Tags:** price-sets
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2018-07-30. Score: 1 | Accepted answer
  
  CiviCRM uses civicrm\_price\_set.name to generate class. I believe this field in never updated on Update mode. It is updated when we explicitly set them using api or mysql query.
  
  > **Comments:**
  > **username_0**: I tested it on 5.6.alpha1 and it does not change now.  
  
  ---
  
  ### Answer by username_2 on 2018-08-03. Score: 1
  
  I'm not sure how much the price fields name will change but perhaps you can use some 'wildcard' attribute selectors? (contains, starts with etc.)
  
  <http://api.jquery.com/category/selectors/attribute-selectors/>
  
  
  ---
  
  