the following code of forms.py
class register(forms.form): username = forms.charfield(label='', max_length=64, widget=forms.textinput({ 'placeholder': 'user name'})) firstname = forms.charfield(label='', max_length=64, widget=forms.textinput({ 'placeholder': 'first name'})) surname = forms.charfield(label='', max_length=64, widget=forms.textinput({ 'placeholder': 'sur name / second name'})) email = forms.emailfield(label='', max_length=64, widget=forms.textinput({ 'placeholder': 'email'}))
while displaying form in simple html file form validation happening, whereas not working in modal dialog window. html code modal dialog window follows:
<div class="col-md-12 text-center"> <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#applyjob">apply job</button> </div> <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> </div> </div> <form action="" method="post"> {% csrf_token %} <div class="modal-body"> {{ form|crispy }} </div> <div class="modal-footer"> <input type="submit" value="apply" class="btn btn-primary"/> </div> </form> </div> </div> </div>
its displaying modal window , taking inputs form validation not happening, please me this. new django.
Comments
Post a Comment