We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Is there any way to render a field with a different widget type? I need to render a select input into a text input.
In the django Form class, for specific reason, I can't set widget=forms.TextInput, but I should be able to do it in a smart way like that:
{% render_field form.start_date class+="form-control" type="text" %}
But what I got is a HTML tag instead.
The text was updated successfully, but these errors were encountered:
That's interesting. It seems it is possible to implement, but it is not implemented now. Check https://github.com/kmike/django-widget-tweaks/blob/master/widget_tweaks/templatetags/widget_tweaks.py#L14 - to inplement it one need to return different widget class in inner as_widget function. I'm open to pull requests for such feature.
as_widget
Sorry, something went wrong.
Amazing 👍
No branches or pull requests
Is there any way to render a field with a different widget type?
I need to render a select input into a text input.
In the django Form class, for specific reason, I can't set widget=forms.TextInput, but I should be able to do it in a smart way like that:
{% render_field form.start_date class+="form-control" type="text" %}
But what I got is a HTML tag instead.
The text was updated successfully, but these errors were encountered: