django-bootstrap-form icon indicating copy to clipboard operation
django-bootstrap-form copied to clipboard

Required fields

Open paveltyavin opened this issue 10 years ago • 8 comments

How required are being rendered? Is there any difference between requiered and not required?

paveltyavin avatar Oct 07 '13 11:10 paveltyavin

As I've seen it doesn't make any difference during rendering.

meteozond avatar Oct 11 '13 12:10 meteozond

Would be nice to add support for this feature.

troygrosfield avatar Nov 10 '13 17:11 troygrosfield

I think it's a bit problematic, because there is no any default approach to required field highlighting in bootstrap.

meteozond avatar Nov 18 '13 07:11 meteozond

As I can see in 3.1 required_css_class was added.
Now you can add your own css for required fields and define it's name on your form like this:

class Form:
    required_css_class = 'requiredField'

So, I think this issue can be closed.

meteozond avatar Dec 10 '13 10:12 meteozond

@meteozond Does it works for you?

I should update the document for this feature

tzangms avatar Dec 10 '13 10:12 tzangms

@tzangms Yes, It does.

meteozond avatar Dec 11 '13 10:12 meteozond

More than that, may be it would be useful, to use default class name (something like "bootstrap_form_required"). And give ability to redefine it in form.

meteozond avatar Dec 11 '13 10:12 meteozond

Is there a reason why not to add "required" attribute for mandatory form fields?

stasdavydov avatar Mar 24 '16 17:03 stasdavydov