Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Add class to input element #525

Open
danielniccoli opened this issue Aug 5, 2023 · 0 comments
Open

Feature Request: Add class to input element #525

danielniccoli opened this issue Aug 5, 2023 · 0 comments

Comments

@danielniccoli
Copy link
Contributor

It would be great if there fields would have a parameter that adds additional css classes to the input directly, just like label_class does for the label. The parameter could be named input_class.

Example:

{% bootstrap_field form.name label_class="visually-hidden" placeholder="Name" wrapper_class="mb-3" input_class="super-style" %}

Output:

<div class="mb-3">
    <label class="form-label visually-hidden" for="id_name">Name</label>
    <input type="text" name="name" class="form-control super-style" placeholder="Name" required="" id="id_name">
</div>
frolenkov-nikita pushed a commit to frolenkov-nikita/django-bootstrap5 that referenced this issue Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant