I have made a modal box using django forms. I am using django crispy forms to beautify the form display. The following is the my html file for displaying my form:
<div id="ApplyJob" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<div class="modal-title">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4>Apply for {{ data.job_title }} position</h4>
</div>
</div>
<form action="" method="post" enctype='multipart/form-data'> {% csrf_token %}
<div class="modal-body">
{{ form|crispy }}
{#<input type="submit" value="Apply" />#}
</div>
<div class="modal-footer">
<input type="submit" value="Apply" class="btn btn-primary"/>
</div>
</form>
</div>
</div>
</div>
Crispy forms has beautified my form as expected, but the input box size of all is wider. Is there any way to reduce the size of of the input box? I have tried adding 'sm-4' but it is reducing the size of input box not the modal box.
My forms.py file is as follows:
class Upload_resume(forms.Form):
f_name = forms.CharField(label='First Name', max_length=64,
widget=forms.TextInput({
'class': 'form-control',
'placeholder': 'First name'}),
required=True)
s_name = forms.CharField(label='Sur Name / Second Name', max_length=64,
widget=forms.TextInput({
'class': 'form-control',
'placeholder': 'Second name'}),
required=True)
email = forms.EmailField(max_length=64,
widget=forms.EmailInput({
'class': 'form-control',
'placeholder': 'example@example.com'}),
required=True)
# text = forms.CharField(label='Few words about you', widget=forms.Textarea, required = False )
phone_no = forms.CharField(widget=forms.TextInput(attrs={'type':'number',
'class': 'form-control',
'placeholder': '+97123456789'}))
resume = forms.Field(label='Upload Resume', widget = forms.FileInput, required = True)
Is there any way to reduce the input box width? Please help I am new to django.