Closed nekdfl closed 5 years ago
to solve this task need add attribite 'pattern' - work as HTML5. class BanksForm(forms.ModelForm): bic = forms.CharField(widget=TextInput(attrs={'type':'text', 'pattern':'[0-9.]+'}), required=True, max_length = 15) ...Class Meta: ...
But it not numeric field. For more secure in model I did used RegexValidator
Hi! I just started using django-сruds. How to customize a widget for text fields? I added the decimal field to the model, created the decimalfield.html file in the columns folder. But when displayed, it looks like a counter field with up and down arrows to change the value. But I need it to be like an ordinary text field, only with numerical input. To reproduce add decimal field to any model.