Add a CSS class on required fields labels
This makes it possible to add a ' *' required notifier to labels without needing a bunch of custom form code in templates.
This commit is contained in:
		
							parent
							
								
									a162559a05
								
							
						
					
					
						commit
						2d4b29e6d9
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		|  | @ -62,6 +62,8 @@ class StripeWidgetProxy(widgets.Widget): | |||
| 
 | ||||
| class CreditCardForm(forms.Form): | ||||
| 
 | ||||
|     required_css_class = 'label-required' | ||||
| 
 | ||||
|     def _media(self): | ||||
|         js = ( | ||||
|             'https://js.stripe.com/v2/', | ||||
|  | @ -142,6 +144,8 @@ class CreditCardForm(forms.Form): | |||
| 
 | ||||
| class StripeRefundForm(forms.Form): | ||||
| 
 | ||||
|     required_css_class = 'label-required' | ||||
| 
 | ||||
|     def __init__(self, *args, **kwargs): | ||||
|         ''' | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Sachi King
						Sachi King