Hi everyone!
I'm trying to allow same day booking for my calendar using the
t-datepicker. I'm trying to use different methods from the
documentation to allow same day booking. For example to allow users to
book from 6th of june till 6th of June. However it's not allowing that
and always adds an extra day when booking. The code is below.
<div class="modal fade" id="myModal">
<div class=row>
<div class="col-sm-10 offset-sm-1">
<div class="modal-dialog modal-lg">
<form action="" method="POST">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<h4 class="modal-title">Quick Booking</h4>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<!-- Modal body -->
<div class="modal-body">
{{ csrf_field() }}
#isset($error_msg)
#foreach ($error_msg as $error)
<li class="text-danger">{{ $error }}</li>
#endforeach
#endisset
<div class="form-group row">
<label for="placeid" class="col-md-4 col-form-label text-md-right">{{ __('Place ID') }}: </label>
<div class="col-md-6">
<input type="text" class="form-control" name="place_id" required>
</div>
</div>
<div class="form-group row">
<label for="placeid" class="col-md-4 col-form-label text-md-right">{{ __('Arrival day') }}: </label>
<div class="col-md-6">
<div class="container11">
<div class="t-datepicker">
<span id="tdatepik" class="t-check-in"></span>
<span id="searchdate_numberofdays" class="t-check-out"></span>
#isset($maparray['err_msg'])
<span id="errormsg_txt" style="color:red;"> {{ __('You can book maximum') }} {{ $maparray["set_admin"]->max_no_days }} {{ __('days') }}.</span><br>
#endisset
<span id="errormsg_txt" style="color:red;display:none;"> {{ __('Arrival day is not selected') }}. </span><br>
</div>
</div>
</div>
</div>
<div class="form-group row">
<label for="fullname" class="col-md-4 col-form-label text-md-right">{{ __('Full Name') }}: </label>
<div class="col-md-6">
<input type="text" class="form-control" name="user_fullname" required>
</div>
</div>
<div class="form-group row">
<label for="email" class="col-md-4 col-form-label text-md-right">{{ __('Email address') }}: </label>
<div class="col-md-6">
<input type="email" class="form-control" name="user_email" required>
</div>
</div>
<div class="form-group row">
<label for="phone" class="col-md-4 col-form-label text-md-right">{{ __('Phone') }}: </label>
<div class="col-md-6">
<input type="tel" class="form-control" name="user_phone" required>
</div>
</div>
<div class="form-group row">
<label for="geust" class="col-md-4 col-form-label text-md-right">{{ __('Number of adults') }}[1-4]: </label>
<div class="col-md-6">
<select class="form-control booking_inp_textbox_style" id="numberofguest" name="numberofguest" onchange="addFieldsadmin(this.value);">
<option value="0" active>1</option>
<option value="1">2</option>
<option value="2">3</option>
<option value="3">4</option>
</select>
</div>
</div>
<div class="form-group row">
<label for="babies" class="col-md-4 col-form-label text-md-right">{{ __('Number of babies') }}[1-4]: </label>
<div class="col-md-6">
<select class="form-control booking_inp_textbox_style" id="numberofbabies" name="numberofbabies" onchange="addFieldsadmin2(this.value);">
<option value="0" active>0</option>
<option id="hidden_op_style1" value="1">1</option>
<option id="hidden_op_style2" value="2">2</option>
<option id="hidden_op_style3" value="3">3</option>
<option id="hidden_op_style4" value="4">4</option>
</select>
</div>
</div>
<div class="containerinput">
{{-- dynamic input surname using javascript --}}
</div>
<div class="containerinput2">
{{-- dynamic input surname using javascript --}}
</div>
<div class="form-group row">
<label for="promo" class="col-md-4 col-form-label text-md-right">{{ __('Promo Code') }}: </label>
<div class="col-md-6">
<input type="text" class="form-control" name="user_promo">
</div>
</div>
<div class="form-group row">
<label for="book" class="col-md-4 col-form-label text-md-right">{{ __('Booked By') }}: </label>
<div class="col-md-6">
<label>{{ Auth::user()->name }}</label>
</div>
</div>
#if (Auth::user()->role == 'admin')
<div class="form-group row">
<label for="Ammount" class="col-md-4 col-form-label text-md-right">{{ __('Payment Type') }}: </label>
<div class="col-md-6">
<input type="radio" name="user_payment_type" value="Entrance">
<label for="Entrance" class="booking_payment_type_style">{{ __('Entrance (Cash)') }}</label>
<input type="radio" name="user_payment_type" value="Admin" checked>
<label for="Entrance" class="booking_payment_type_style">{{ __('Admin (Free)') }}</label><br>
</div>
</div>
#else
<div class="form-group row">
<label for="promo" class="col-md-4 col-form-label text-md-right">{{ __('Payment Type') }}: </label>
<div class="col-md-6">
<input type="radio" name="user_payment_type" value="Entrance" checked>
<label for="Entrance" class="booking_payment_type_style">{{ __('Entrance (Cash)') }}</label>
</div>
</div>
#endif
</div>
<!-- Modal footer -->
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-success">{{ __('Save') }}</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<script>
var today = new Date();
tomorrow = new Date(today);
tomorrow.setDate(tomorrow.getDate() + 60);
var date = tomorrow.getFullYear()+'-'+(tomorrow.getMonth()+1)+'-'+tomorrow.getDate();
$(document).ready(function(){
// Call global the function
$('.t-datepicker').tDatePicker({
// options here
titleDateRange :'{{ __('day') }}',
titleDateRanges:'{{ __('days') }}',
titleToday :'{{ __('Today') }}',
limitDateRanges :'{{ $set_admin->max_no_days+300 }}',
titleCheckIn :'{{ __('Check In') }}',
titleCheckOut :'{{ __('Check Out') }}',
numCalendar : 1,
//endDate: date,
nextDayHighlighted :false,
toDayHighlighted :true,
toDayShowTitle :true,
autoClose: true,
dateRangesHover: false,
});
});
// $('.t-datepicker').tDatePicker('setEndDate','2020-07-28');
</script>
<script type="text/javascript">
#isset($error_msg)
#if (count($error_msg) > 0)
$('#myModal').modal('show');
#endif
#endisset
</script>
Related
I am having template that I got from one of mu front-end developers who is not familiar with python and Django. In order to keep the design as it is right now, I would liketo use only template and its view for objects modification, instead there is a way to use the same design by using forms.py.
For your information, I was able to use the same desing in the adding function but in the editing function it is not working.
How can I do it without having to change the front-design?
Temlapte.html
{% extends 'base.html' %}
{% load static %}
{% block title %}
<title>Liste des employés</title>
{% endblock title %}
{% block content %}
<!-- Main Wrapper -->
<div class="main-wrapper">
<div class="page-wrapper">
<!-- Page Content -->
<div class="content container-fluid">
<!-- Page Header -->
<div class="page-header">
<div class="row align-items-center">
<div class="col">
<h3 class="page-title">Employé</h3>
<ul class="breadcrumb">
<li class="breadcrumb-item">Tableau de bord</li>
<li class="breadcrumb-item active">Employé</li>
</ul>
</div>
<div class="col-auto float-end ms-auto">
<i class="fa fa-plus"></i> Ajouter un employé
<div class="view-icons">
<i class="fa fa-th"></i>
<i class="fa fa-bars"></i>
</div>
</div>
</div>
</div>
<!-- /Page Header -->
<!-- Search Filter -->
<div class="row filter-row">
<div class="col-sm-6 col-md-3">
<div class="form-group form-focus">
<input type="text" class="form-control floating">
<label class="focus-label">ID employé</label>
</div>
</div>
<div class="col-sm-6 col-md-3">
<div class="form-group form-focus">
<input type="text" class="form-control floating">
<label class="focus-label">Nom employé</label>
</div>
</div>
<div class="col-sm-6 col-md-3">
<div class="form-group form-focus select-focus">
<select class="select" name="service">
<option value="">Selectionner une grade</option>
{% for grade in listeGrade %}
<option value="{{ grade.id }}">{{ grade.niveau_grade }}</option>
{% endfor %}
</select>
<label class="focus-label">Grade</label>
</div>
</div>
<div class="col-sm-6 col-md-3">
<div class="d-grid">
Rechercher
</div>
</div>
</div>
<!-- Search Filter -->
<div class="row staff-grid-row">
{% for emp in listEmp %}
<div class="col-md-4 col-sm-6 col-12 col-lg-4 col-xl-3">
<div class="profile-widget">
{% if emp.photo %}
<div class="profile-img">
<img src="{{ emp.photo.url }}" alt="">
</div>
{% endif %}
<div class="dropdown profile-action">
<i class="material-icons">more_vert</i>
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item" href="{% url 'hr:edit-employee' emp.id %}" data-bs-toggle="modal" data-bs-target="#edit_employee"><i class="fa fa-pencil m-r-5"></i> Modifier</a>
<a class="dropdown-item" href="{% url 'hr:remove-employee' emp.id %}" data-bs-toggle="modal" data-bs-target="#delete_employee"><i class="fa fa-trash-o m-r-5"></i> Supprimer</a>
</div>
</div>
<h4 class="user-name m-t-10 mb-0 text-ellipsis">{{ emp.nom}} {{ emp.prenom}}</h4>
<div class="small text-muted">{{ emp.qualification }}</div>
</div>
</div>
{% endfor %}
</div>
<!-- /Page Content -->
<!-- Add Employee Modal -->
<div id="add_employee" class="modal custom-modal fade" role="dialog">
<div class="modal-dialog modal-dialog-centered modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Ajouter une employé</h5>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form action="" method="post" enctype="multipart/form-data"> {% csrf_token %}
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-form-label">ID employé <span class="text-danger">*</span></label>
<input class="form-control" type="text" name="id_Personnel">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-form-label">Prénom <span class="text-danger">*</span></label>
<input class="form-control" type="text", name="prenom">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-form-label">Nom</label>
<input class="form-control" type="text" name="nom">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-form-label">Date de naissance<span class="text-danger">*</span></label>
<div class="cal-icon"><input class="form-control" type="text" name="date_de_naissance" placeholder="YYYY-MM-DD"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Sexe <span class="text-danger">*</span></label>
<select class="select" name="sexe">
<option>Selectionner le sexe</option>
<option value="M">Masculin</option>
<option value="F">Féminin</option>
</select>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-form-label">CIN <span class="text-danger">*</span></label>
<input class="form-control" type="text" name="CIN">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-form-label">Photo</label>
<input class="form-control" type="file" name="photo">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-form-label">Téléphone <span class="text-danger">*</span></label>
<input class="form-control" type="text" name="telephone">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-form-label">Email</label>
<input class="form-control" type="email" name="email">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-form-label">Adresse actuelle<span class="text-danger">*</span></label>
<input class="form-control" type="text" name="adresse_actuelle">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-form-label">Adresse permanente<span class="text-danger">*</span></label>
<input type="text" class="form-control" name="adresse_permanente">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-form-label">Date d'embauche<span class="text-danger">*</span></label>
<div class="cal-icon"><input class="form-control" type="text" name="date_de_recrutement" placeholder="YYYY-MM-DD"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Service <span class="text-danger">*</span></label>
<select class="select" name="service">
<option value="">Selectionner un service</option>
{% for service in listeService %}
<option value="{{ service.id }}">{{ service.Service }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Diplôme obtenu <span class="text-danger">*</span></label>
<select class="select" name="diplome_obtenu">
<option>Selectionner un diplôme</option>
<option value="DEUG">DEUG</option>
<option value="LICENCE">LICENCE</option>
<option value="MAITRISE">MAITRISE</option>
<option value="MASTER">MASTER</option>
<option value="DOCTORAT">DOCTORAT</option>
<option value="AUTRE">AUTRE</option>
</select>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-form-label">Qualification </label>
<input class="form-control" type="text" name="qualification">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Grade</label>
<select class="select" name="grade">
<option value="">Selectionner une grade</option>
{% for grade in listeGrade %}
<option value="{{ grade.id }}">{{ grade.niveau_grade }}</option>
{% endfor %}
</select>
</div>
</div>
</div>
<div class="submit-section">
<button class="btn btn-primary submit-btn">Enrégistrer</button>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- /Add Employee Modal -->
<!-- Edit Employee Modal -->
<div id="edit_employee" class="modal custom-modal fade" role="dialog">
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Modifier un employé</h5>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form action="" method="post" enctype="multipart/form-data">
{% csrf_token %}
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-form-label">ID employé <span class="text-danger">*</span></label>
<input class="form-control" type="text" name="id_Personnel" value="{{ emp_name.id_Personnel }}">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-form-label">Prénom <span class="text-danger">*</span></label>
<input class="form-control" type="text", name="prenom" value="{{ emp_name.prenom }}">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-form-label">Nom</label>
<input class="form-control" type="text" name="nom" value="{{ emp_name.nom }}">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-form-label">Date de naissance<span class="text-danger">*</span></label>
<div class="cal-icon"><input class="form-control datetimepicker" type="text" name="date_de_naissance" value="{{ emp_name.date_de_naissance }}"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Sexe <span class="text-danger">*</span></label>
<select class="select" name="sexe">
<option>Selectionner le sexe</option>
<option value="M" {% ifequal emp_name.sexe M %} selected="selected"{% endifequal %} >Masculin</option>
<option value="F" value="M" {% ifequal emp_name.sexe F %} selected="selected"{% endifequal %}>Féminin</option>
</select>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-form-label">CIN <span class="text-danger">*</span></label>
<input class="form-control" type="text" name="CIN" value="{{ emp_name.CIN }}">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-form-label">Photo</label>
<input class="form-control" type="file" name="photo" value="{{ emp_name.photo }}">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-form-label">Téléphone <span class="text-danger">*</span></label>
<input class="form-control" type="text" name="telephone">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-form-label">Email</label>
<input class="form-control" type="email" name="email" value="{{emp_name.email}}">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-form-label">Adresse actuelle<span class="text-danger">*</span></label>
<input class="form-control" type="text" name="adresse_actuelle" value="{{emp_name.adresse_actuelle}}">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-form-label">Adresse permanente<span class="text-danger">*</span></label>
<input type="text" class="form-control" name="adresse_permanente" value="{{emp_name.adresse_permanente}}">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-form-label">Date d'embauche<span class="text-danger">*</span></label>
<div class="cal-icon"><input class="form-control datetimepicker" type="text" name="date_de_recrutement" value="date_de_recrutement"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Service <span class="text-danger">*</span></label>
<select class="select" name="service">
<option value="">Selectionner un service</option>
{% for service in listeService %}
<option value="{{ service.id }}" value="emp_name.service">{{ service.Service }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Diplôme obtenu <span class="text-danger">*</span></label>
<select class="select" name="diplome_obtenu">
<option>Selectionner un diplôme</option>
<option value="DEUG">DEUG</option>
<option value="LICENCE">LICENCE</option>
<option value="MAITRISE">MAITRISE</option>
<option value="MASTER">MASTER</option>
<option value="DOCTORAT">DOCTORAT</option>
<option value="AUTRE">AUTRE</option>
</select>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-form-label">Qualification </label>
<input class="form-control" type="text" name="qualification">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Grade</label>
<select class="select" name="grade">
<option value="">Selectionner une grade</option>
{% for grade in listeGrade %}
<option value="{{ grade.id }}">{{ grade.niveau_grade }}</option>
{% endfor %}
</select>
</div>
</div>
</div>
<div class="submit-section">
<button class="btn btn-primary submit-btn">Enregistrer les modifications</button>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- /Edit Employee Modal -->
</div>
<!-- /Page Wrapper -->
</div>
<!-- /Main Wrapper -->
{% endblock content %}
Adding views:
def ListEmployeeGrid(request):
template ='employees/employees.html'
listEmp=Personnel.objects.all()
listeGrade=Grades.objects.all()
listeService=Services.objects.all()
form = EmployeeAddForm(request.POST or None,request.FILES)
if request.method=='POST':
# if forms.is_valid():
Personnel.objects.create(
id_Personnel=request.POST["id_Personnel"],
photo = request.FILES["photo"],
prenom = request.POST["prenom"],
nom = request.POST["nom"],
sexe= request.POST["sexe"],
date_de_naissance= request.POST["date_de_naissance"],
CIN = request.POST['CIN'],
telephone =request.POST["telephone"],
email = request.POST["email"],
adresse_actuelle = request.POST["adresse_actuelle"],
adresse_permanente = request.POST["adresse_permanente"],
diplome_obtenu = request.POST["diplome_obtenu"],
qualification = request.POST["qualification"],
grade = Grades.objects.get(id=request.POST["grade"]),
date_de_recrutement = request.POST["date_de_recrutement"],
service = Services.objects.get(id=request.POST["service"]),
create_date = date.today(),
updateDate = date.today(),
)
# return redirect('hr:list_employee')
context={
'listEmp':listEmp,
'listeGrade':listeGrade,
'listeService':listeService
}
return render(request, template, context)
Employ edition view
def Edit_Employee(request, id):
emp_name=get_object_or_404(Personnel,id=id)
listEmp=Personnel.objects.all()
listeGrade=Grades.objects.all()
listeService=Services.objects.all()
Personnel.objects.update_or_create(
id_Personnel=request.POST["id_Personnel"],
photo = request.FILES["photo"],
prenom = request.POST["prenom"],
nom = request.POST["nom"],
sexe= request.POST["sexe"],
date_de_naissance= request.POST["date_de_naissance"],
CIN = request.POST['CIN'],
telephone =request.POST["telephone"],
email = request.POST["email"],
adresse_actuelle = request.POST["adresse_actuelle"],
adresse_permanente = request.POST["adresse_permanente"],
diplome_obtenu = request.POST["diplome_obtenu"],
qualification = request.POST["qualification"],
grade = Grades.objects.get(id=request.POST["grade"]),
date_de_recrutement = request.POST["date_de_recrutement"],
service = Services.objects.get(id=request.POST["service"]),
create_date = date.today(),
updateDate = date.today(),)
return render(request,'employees/employees.html',
{
"emp_name": emp_name,
"listEmp":listEmp,
"listeService":listeService,
"listeGrade":listeGrade,
}
)
I have a form to register a student.
The form submits when i use the following code
<div class="text-xs-right">
<i class="ti-save-alt"></i> <input type="submit" class="btn btn-info btn-rounded mb-5" value="Register">
</div>
But it just refreshes if i use the Button type Submit (below code)
<button type="submit" value="Submit" class="btn btn-rounded btn-primary btn-outline">
<i class="ti-save-alt"></i> Register
</button>
Can someone please help me understand what am i doing wrong here?
I tried to check if there is any jquery/Js Conflicts by commenting out the scripts. Nothing works.
I need to have the button working, as i am using fa icons to style them.
Thank in advance.
My full form code
<form class="form" method="post" action="{{ route('learner.store') }}">
#csrf
<div class="box-body">
<h4 class="box-title text-info"><i class="ti-user mr-15"></i> Personal Info</h4>
<hr class="my-15">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label>CPR Number</label>
<input type="text" name="cprnumber" class="form-control" placeholder="CPR Number" required data-validation-required-message="This field is required">
</div>
#error('cprnumber')
<span class="text-info">{{ $message }}</span>
#enderror
</div>
<div class="col-md-4">
<div class="form-group">
<label>First Name</label>
<input type="text" name="firstname" class="form-control" placeholder="First Name">
</div>
#error('firstname')
<span class="text-info">{{ $message }}</span>
#enderror
</div>
<div class="col-md-4">
<div class="form-group">
<label>Middle Name</label>
<input type="text" name="middlename" class="form-control" placeholder="Middle Name">
</div>
#error('middlename')
<span class="text-info">{{ $message }}</span>
#enderror
</div>
<div class="col-md-4">
<div class="form-group">
<label>Last Name</label>
<input type="text" name="lastname" class="form-control" placeholder="Last Name">
</div>
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="form-group">
<label>Gender</label>
<select name="learnergender" id="select" required class="form-control">
<option value="">Select</option>
<option value="Male">Male</option>
<option value="Female">Female</option>
</select>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Date of Birth</label>
<input type="date" name="learnerdob" class="form-control" required data-validation-required-message="This field is required">
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Nationality</label>
<select name="learnernationality" id="select" required class="form-control">
<option value="">Select</option>
<option value="Bahraini">Bahraini</option>
<option value="Non-Bahraini">Non Bahraini</option>
</select>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Marital Status</label>
<select name="learnermaritalstatus" id="select" required class="form-control">
<option value="">Select</option>
<option value="Single">Single</option>
<option value="Married">Married</option>
<option value="Divorced">Divorced</option>
<option value="Widowed">Widowed</option>
</select>
</div>
</div>
</div>
<h4 class="box-title text-info"><i class="ti-save mr-15"></i> Contact Details</h4>
<hr class="my-15">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>E-mail</label>
<input type="email" name="learneremail" class="form-control" placeholder="E-mail">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Mobile Number</label>
<input type="text" name="learnermobile" class="form-control" placeholder="Phone">
</div>
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="form-group">
<label>Building Number</label>
<input type="text" name="buildingnumber" class="form-control" placeholder="Building Number">
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Road Number</label>
<input type="text" name="roadnumber" class="form-control" placeholder="Road Number">
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Block Number</label>
<input type="text" name="blocknumber" class="form-control" placeholder="Block Number">
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Area</label>
<input type="text" name="area" class="form-control" placeholder="Area">
</div>
</div>
</div>
<h4 class="box-title text-info"><i class="ti-save mr-15"></i> Education Details</h4>
<hr class="my-15">
<div class="row">
<div class="col-md-2">
<div class="form-group">
<label>Education Level</label>
<select name="educationlevel" id="select" required class="form-control">
<option value="">Select</option>
<option value="Primary">Primary</option>
<option value="Preparatory">Preparatory</option>
<option value="Secondary">Secondary</option>
<option value="Diploma">Diploma</option>
<option value="Bachelor">Bachelor</option>
<option value="Masters/PHD">Masters/PHD</option>
</select>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label>Grade</label>
<input type="text" name="learnergrade" class="form-control" placeholder="Grade">
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Graduation Date</label>
<input type="date" name="graduationdate" class="form-control" required data-validation-required-message="This field is required">
</div>
</div>
</div>
<h4 class="box-title text-info"><i class="ti-save mr-15"></i> Organisation Details</h4>
<hr class="my-15">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label>Organisation</label>
<input type="text" name="organisation" class="form-control" placeholder="Organisation">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Office E-mail</label>
<input type="email" name="officeemail" class="form-control" placeholder="Office E-mail">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Office Number</label>
<input type="text" name="officenumber" class="form-control" placeholder="Office Phone">
</div>
</div>
</div>
<div class="row">
<div class="col-md-2">
<div class="form-group">
<label>Position</label>
<input type="text" name="position" class="form-control" placeholder="Position">
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label>Department</label>
<input type="text" name="department" class="form-control" placeholder="Department">
</div>
</div>
</div>
<div class="form-group">
<label>Description</label>
<textarea rows="5" name="description" class="form-control" placeholder="Description/Remarks/Notes"></textarea>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
<!-- <button type="button" class="btn btn-rounded btn-warning btn-outline mr-1">
<i class="ti-trash"></i> Cancel
</button>
<button type="submit" value="Submit" class="btn btn-rounded btn-primary btn-outline">
<i class="ti-save-alt"></i> Register
</button> -->
<div class="text-xs-right">
<input type="submit" class="btn btn-info btn-rounded mb-5" value="Register">
</div>
</div>
</form>
Store method
public function LearnerManagementStore(Request $request){
$validatedData =$request->validate([
'cprnumber' => 'required|unique:learner_management',
'firstname' => 'required',
'lastname' => 'required',
'learnerdob' => 'required',
'learneremail' => 'required',
'learnermobile' => 'required',
]);
$data = new LearnerManagement();
$data->cprnumber = $request->cprnumber;
$data->firstname = $request->firstname;
$data->middlename = $request->middlename;
$data->lastname = $request->lastname;
$data->learnergender = $request->learnergender;
$data->learnerdob = $request->learnerdob;
$data->learnernationality = $request->learnernationality;
$data->learnermaritalstatus = $request->learnermaritalstatus;
$data->learneremail = $request->learneremail;
$data->learnermobile = $request->learnermobile;
$data->buildingnumber = $request->buildingnumber;
$data->roadnumber = $request->roadnumber;
$data->blocknumber = $request->blocknumber;
$data->area = $request->area;
$data->educationlevel = $request->educationlevel;
$data->learnergrade = $request->learnergrade;
$data->graduationdate = $request->graduationdate;
$data->organisation = $request->organisation;
$data->officeemail = $request->officeemail;
$data->officenumber = $request->officenumber;
$data->position = $request->position;
$data->department = $request->department;
$data->description = $request->description;
$data->save();
$notification = array (
'message' => 'Learner Added successfully',
'alert-type' => 'success'
);
return redirect()->route('learners.viewall')->with($notification);
}
Route
// Learner Management
Route::prefix('learner')->group(function(){
Route::get('/viewall', [LearnerController::class, 'LearnerManagementViewall'])-> name('learners.viewall');
Route::get('/view/{id}', [LearnerController::class, 'LearnerManagementView'])-> name('learner.view');
Route::get('/add', [LearnerController::class, 'LearnerManagementAdd'])-> name('learner.add');
Route::post('/store', [LearnerController::class, 'LearnerManagementStore'])-> name('learner.store');
Route::get('/edit/{id}', [LearnerController::class, 'LearnerManagementEdit'])-> name('learner.edit');
Route::post('/update/{id}', [LearnerController::class, 'LearnerManagementUpdate'])-> name('learner.update');
Route::get('/delete/{id}', [LearnerController::class, 'LearnerManagementDelete'])-> name('learner.delete');
});
I don't really understand the elements changes after add FORM.
Any suggestion?
BEFORE
AFTER add
{!! Form::model($user, ['method' => 'POST','route' => ['profile.update', $user->id], 'enctype' => 'multipart/form-data']) !!}
Full codes here:(
#include('Navigation.navbarhome')
<div class="container">
{!! Form::model($user, ['method' => 'POST','route' => ['profile.update', $user->id], 'enctype' => 'multipart/form-data']) !!}
#if ($message = Session::get('success'))
<div class="alert alert-success">
{{ session()->get('success') }}
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</div>
#endif
#if ($errors->any())
<div class="alert alert-danger">
<strong>Whoops!</strong> There were some problems with your input.<br><br>
<ul>
#foreach ($errors->all() as $error)
<li>{{ $error }}</li>
#endforeach
</ul>
</div>
#endif
<h1>Edit Profile</h1>
<hr>
<div class="row">
<!-- left column -->
<div class="col-md-3">
<div class="text-center">
<img src="/uploads/avatars/{{ Auth::user()->profImage }}" class="avatar img-circle" alt="avatar">
<h6>Upload your photo...</h6>
<input type="file" name="profImage">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
</div>
</div>
<!-- edit form column -->
<div class="col-md-7 personal-info">
<h3>Personal info</h3>
<form class="form-horizontal" role="form">
<div class="form-group">
<label class="col-lg-3 control-label">First name:</label>
<div class="col-lg-8">
<input class="form-control" name="fname" type="text" value="{{$user->fname}}">
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Last name:</label>
<div class="col-lg-8">
<input class="form-control" name="lname" type="text" value="{{$user->lname}}">
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Staff ID:</label>
<div class="col-lg-8">
<input class="form-control" name="StaffID" type="text" value="{{$user->StaffID}}" readonly>
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Email:</label>
<div class="col-lg-8">
<input class="form-control" name="email" type="text" value="{{$user->email}}">
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Department:</label>
<div class="col-lg-8">
<input class="form-control" name="dept" type="text" value="{{$user->department1->name}}" readonly>
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Position:</label>
<div class="col-lg-8">
<input class="form-control" name="role" type="text" value="{{$user->position->name}}" readonly>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label"></label>
<div class="col-md-8">
<input type="submit" class="btn btn-primary" value="Save Changes">
<span></span>
<a href="/home2"> <input type="button" href="/home2" class="btn btn-default" value="Cancel">
</div>
</div>
</form>
{!! Form::close() !!}
</div>
</div>
</div>
<hr>
This is occurring because there's already an existing <form> element within your code, and nesting these elements is causing issues within the styling.
You should be able to address it by simply changing your inner <form> element into a <div> since it isn't doing much except for handling styling (via the form-horizontal class).
Just change the following line from:
<form class="form-horizontal" role="form">
to:
<div class="form-horizontal" role="form">
Example (with changes applied)
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
<!-- This element is added by Laravel -->
<form>
<h1>Edit Profile</h1>
<hr>
<div class="row">
<!-- left column -->
<div class="col-md-3">
<div class="text-center">
<img src="" class="avatar img-circle" alt="avatar">
<h6>Upload your photo...</h6>
<input type="file" name="profImage">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
</div>
</div>
<!-- edit form column -->
<div class="col-md-7 personal-info">
<h3>Personal info</h3>
<!-- Change this to a <form> to reproduce your original issue -->
<div class="form-horizontal" role="form">
<div class="form-group">
<label class="col-lg-3 control-label">First name:</label>
<div class="col-lg-8">
<input class="form-control" name="fname" type="text" value="{{$user->fname}}">
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Last name:</label>
<div class="col-lg-8">
<input class="form-control" name="lname" type="text" value="{{$user->lname}}">
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Staff ID:</label>
<div class="col-lg-8">
<input class="form-control" name="StaffID" type="text" value="{{$user->StaffID}}" readonly>
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Email:</label>
<div class="col-lg-8">
<input class="form-control" name="email" type="text" value="{{$user->email}}">
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Department:</label>
<div class="col-lg-8">
<input class="form-control" name="dept" type="text" value="{{$user->department1->name}}" readonly>
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Position:</label>
<div class="col-lg-8">
<input class="form-control" name="role" type="text" value="{{$user->position->name}}" readonly>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label"></label>
<div class="col-md-8">
<input type="submit" class="btn btn-primary" value="Save Changes">
<span></span>
<input type="button" href="/home2" class="btn btn-default" value="Cancel">
</div>
</div>
</div>
</div>
</div>
<hr>
</form>
</div>
this is my html form and when serialize this form and send formdata to spring boot end point it gives 400 error also there is no file name and its value in browser inspect why this happen?
And I am using Thymeleaf for generate template. why In my form data has not file name and value?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<form class="md-float-material form-material" id="schoolRegForm" method="post" enctype="multipart/form-data">
<!--<form id="schoolDetailsForm" enctype="multipart/form-data">-->
<!--school logo preview-->
<div class="form-group row justify-content-center">
<div class="avatar centered box-shadow" style="height: 200px;width: 200px;border-radius: 200px;border: 2px solid white">
<img id="schoolLogoPreview" th:src="#{/dist/images/default-image.png}" src="" alt="School Logo" style="height: 200px;width: 200px;border-radius: 200px;border: none"
/>
</div>
</div>
<!--this is place that my issue comes-->
<!--school logo-->
<div class="form-group row">
<label class="col-lg-4 col-form-label" for="">
School Logo
</label>
<div class="col-lg-6">
<div class="row">
<div class="col-md-12 col-sm-12">
<div class="input-group">
<div class="custom-file">
<input class="" type="file" accept="image/*" id="schoolLogoInput" name="schoollogofile">
<label class="custom-file-label" for="schoolLogoInput">Choose
file</label>
</div>
</div>
</div>
<div class="col-md-12 col-sm-12">
<label id="schoolLogoValidateNotify" class="text-danger d-none">
<i class="fa wr"></i> Image is correct
</label>
</div>
</div>
</div>
</div>
<!-- student image select -->
<div class="form-group row">
<label class="col-lg-4 col-form-label" for="student-image">
Student Image
</label>
<div class="col-lg-6">
<div class="input-group">
<input id="student-image" type="file" class="form-control" accept="image/*" onchange="loadCertificate(event)" name="photopathfile">
</div>
</div>
</div>
<!-- student image preview -->
<div class="form-group row">
<label class="col-lg-4 col-form-label" for="">
Uploaded Image Preview
</label>
<div class="col-lg-6">
<div class="avatar">
<img class="img-thumbnail" id="studentbirthCertificatePreview" style="width: 250px" />
</div>
</div>
</div>
<!--school name-->
<div class="form-group row">
<label class="col-lg-4 col-form-label" for="schoolNameInput">
School Name <span class="text-danger">*</span>
</label>
<div class="col-lg-6">
<input id="schoolNameInput" type="text" class="form-control" name="schoolname" placeholder="school name">
<span id="schoolNameErrorMessage" class=""></span>
</div>
</div>
<!--school address-->
<div class="form-group row">
<label class="col-lg-4 col-form-label" for="schoolAddressInput">
School Address
<span class="text-danger">*</span>
</label>
<div class="col-lg-6">
<textarea id="schoolAddressInput" type="textarea" class="form-control" name="schooladdress" placeholder="school address"
style="height: 100px;"></textarea>
<span id="schoolAddressErrorMessage" class=""></span>
</div>
</div>
<!--school province-->
<div class="form-group row">
<label class="col-lg-4 col-form-label" for="schoolProvinceInput">
Province
<span class="text-danger">*</span>
</label>
<div class="col-lg-6">
<!-- school division input-->
<select id="schoolProvinceInput" class="form-control" onchange="setDistrictOptions(this.value)" name="schoolprovince">
<option value="Central">Central Province</option>
<option value="Eastern">Eastern Province</option>
<option value="North Central">North Central Province</option>
<option value="Northern">Northern Province</option>
<option value="North Western">North Western Province</option>
<option value="Sabaragamuwa">Sabaragamuwa Province</option>
<option value="Southern">Southern Province</option>
<option value="Uva">Uva Province</option>
<option value="Western">Western Province</option>
</select>
<span id="schoolProvinceErrorMessage" class=""></span>
<!-- <input id="schoolProvinceInput" type="text" class="form-control mt-2"-->
<!-- name="schooldivision" placeholder="Enter province here">-->
<!-- <span id="schoolDivisionErrorMessage" class=""></span>-->
</div>
</div>
<!--school district-->
<div class="form-group row">
<label class="col-lg-4 col-form-label" for="schoolDistrictInput">
District
<span class="text-danger">*</span>
</label>
<div class="col-lg-6">
<select id="schoolDistrictInput" class="form-control" name="schooldistrict">
</select>
<span id="schoolDistrictErrorMessage" class=""></span>
<!-- <input id="schoolDistrictInput" type="text" class="form-control mt-2"-->
<!-- name="schooldistrict" placeholder="Enter district here">-->
</div>
</div>
<!--school division-->
<div class="form-group row">
<label class="col-lg-4 col-form-label" for="schoolDivisionInput">
Division
<span class="text-danger">*</span>
</label>
<div class="col-lg-6">
<select id="schoolDivisionInput" class="form-control" name="schooldivision">
</select>
<!-- <input id="schoolDivisionInput" type="text" class="form-control mt-2"-->
<!-- name="schooldivision" placeholder="Enter division here">-->
<!-- <span id="schoolProvinceErrorMessage" class=""></span>-->
</div>
</div>
<!--school region-->
<div class="form-group row">
<label class="col-lg-4 col-form-label" for="schoolRegion">
School Region
</label>
<div class="col-lg-6">
<input id="schoolRegion" type="text" class="form-control" name="schoolregion" placeholder="Enter region here">
<span id="schoolRegionErrorMessage" class=""></span>
</div>
</div>
<!--school vision-->
<div class="form-group row">
<label class="col-lg-4 col-form-label" for="schoolVisionInput">
School Vision
</label>
<div class="col-lg-6">
<textarea id="schoolVisionInput" type="textarea" class="form-control" name="schoolvision" placeholder="Enter vision here"
style="height: 100px"></textarea>
<span id="schoolVisionErrorMessage" class=""></span>
</div>
</div>
<!--school mission-->
<div class="form-group row">
<label class="col-lg-4 col-form-label" for="schoolMissionInput">
School Mission
</label>
<div class="col-lg-6">
<textarea id="schoolMissionInput" type="textarea" class="form-control" name="schoolmission" placeholder="Enter mission here"
style="height: 100px"></textarea>
<span id="schoolMissionErrorMessage" class=""></span>
</div>
</div>
<!--school email-->
<div class="form-group row">
<label class="col-lg-4 col-form-label" for="schoolEmailInput">
School Email
</label>
<div class="col-lg-6">
<input id="schoolEmailInput" type="email" class="form-control" name="schoolemail" placeholder="school email">
<span id="schoolEmailErrorMessage" class=""></span>
</div>
</div>
<!--school contact no1-->
<div class="form-group row">
<label class="col-lg-4 col-form-label" for="schoolContactNoInput1">
School Contact Number
<span class="text-danger">*</span>
</label>
<div class="col-lg-6">
<input id="schoolContactNoInput1" type="text" class="form-control" name="schooltelephone" placeholder="school contact number 01">
<span id="schoolContactNo1ErrorMessage" class=""></span>
</div>
</div>
<!--school contact no2-->
<div class="form-group row">
<label class="col-lg-4 col-form-label" for="schoolContactNoInput2">
</label>
<div class="col-lg-6">
<input id="schoolContactNoInput2" type="text" class="form-control" name="schooltelephonsecond" placeholder="school contact number 02">
<span id="schoolContactNo2ErrorMessage" class=""></span>
</div>
</div>
<!--school grade span -->
<div class="form-group row">
<label class="col-lg-4 col-form-label" for="schoolGradeSpanInput">
School Grade Span <span class="text-danger">*</span>
</label>
<div class="col-lg-6">
<input id="schoolGradeSpanInput" type="text" class="form-control" name="gradespan" placeholder="Enter Grade here">
<span id="schoolGradeSpanErrorMessage" class=""></span>
</div>
</div>
<!--school number-->
<div class="form-group row">
<label class="col-lg-4 col-form-label" for="schoolNumberInput">
School Number <span class="text-danger">*</span>
</label>
<div class="col-lg-6">
<input id="schoolNumberInput" type="number" class="form-control" name="schoolnumber" placeholder="Enter number here">
<span id="schoolNumberErrorMessage" class=""></span>
</div>
</div>
<!-- School Census -->
<div class="form-group row">
<label class="col-lg-4 col-form-label" for="schoolCensusInput">
School Census
</label>
<div class="col-lg-6">
<input id="schoolCensusInput" type="number" class="form-control" name="schoolcensusnumber" placeholder="Enter school census">
<span id="schoolStudentPopulationErrorMessage" class=""></span>
</div>
</div>
<!--school type-->
<div class="form-group row">
<label class="col-lg-4 col-form-label" for="schoolTypeInput">
School Type
</label>
<div class="col-lg-6">
<select id="schoolTypeInput" type="text" class="form-control" name="schooltype">
<option selected value="National"> National</option>
<option value="Type 1AB"> Type 1C</option>
<option value="Type 1AB"> Type 2</option>
<option value="Type 1AB"> Type 3</option>
</select>
</div>
</div>
<!--school anthem-->
<div class="form-group row">
<label class="col-lg-4 col-form-label" for="schoolAnthemInput">
School Anthem
</label>
<div class="col-lg-6">
<textarea id="schoolAnthemInput" type="textarea" class="form-control" name="schoolanthem" placeholder="Enter School Anthem"
style="height: 100px"></textarea>
<span id="schoolAnthemErrorMessage" class=""></span>
</div>
</div>
<div class="form-group row">
<div class="col-lg-8 ml-auto">
<!--save button-->
<button id="saveSchoolDetails" type="button" class="btn btn-success m-2">
<i class="fa fa-check"></i> Save Settings
</button>
<!-- go back button-->
<label id="goBackButton" class="text-info m-2">
<i class="fa fa-backward"></i> Go back to Register
</label>
</div>
</div>
</form>
</body>
</html>
This is my ajax call
$.ajax({
type: "POST",
enctype: 'multipart/form-data',
url: baseURL + 'register',
data: newForm ,
// + '&schoollogofile=' + file, //
dataType: 'json',
async:true,
// processData: false,
// contentType: false,
success: function (data) {
alert("registered" + data);
},
}).done(function (data) {
alert(data);
});
Finally i found problem thanks all this is the ajax call
function registerSchoolAndAdmin() {
let schoolRegForm = $('#schoolRegForm')[0];
// var formData = new FormData(document.forms['form-ship']); // with the file input
let formData = new FormData(schoolRegForm);
let poData = $(document.forms['signUpForm']).serializeArray();
for (let i=0; i<poData.length; i++)
formData.append(poData[i].name, poData[i].value);
$.ajax({
type: "POST",
url: baseURL + 'register',
data: formData ,
// dataType: 'json',
async:true,
processData: false,
contentType: false,
success: function (data) {
let adminid = analizeResponse(data);
console.log("adminID" + adminid);
locateMethod(data);
},
}).done(function (data) {
alert(data);
});
}
I am trying to form submit in Django with multiple details so I have decided to separate have the next button and the first set of details will be hidden and the next set will be displayed and the form submission will happen in the last set of details. I have finished the code and placed the tag on the beginning and the closing tag at the bottom. But the form was not submitting. It was not showing any error. When I click the button nothing happened
<form method="POST">{% csrf_token %}
<div id="personal_info">
<div class="container">
<div class="form-row">
<div class="form-group col-md-4">
<label for="firstname">First Name</label>
{{form.first_name}}
</div>
<div class="form-group col-md-4">
<label for="middlename">Middle Name</label>
{{form.middle_name}}
</div>
<div class="form-group col-md-4">
<label for="lastname">Last Name</label>
{{form.last_name}}
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label for="emailadd">Email Address</label>
{{form.email_address}}
</div>
<div class="form-group col-md-5">
<label for="contact">Contact No</label>
{{form.contact_no}}
</div>
<div class="form-group col-md-1">
<label for="contact">Age</label>
<input type="number" class="form-control" id="contact">
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
<label for="position">Position</label>
{{ form.position_applied_for }}
</div>
<div class="form-group col-md-4">
<label for="gender">Gender</label>
{{ form.sex }}
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label for="birthplace">Place of birth</label>
{{ form.place_of_birth }}
</div>
<div class="form-group col-md-6">
<label for="birthdate">Date of birth</label>
{{ form.date_of_birth }}
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label for="city_address">City Address</label>
{{ form.city_add }}
</div>
<div class="form-group col-md-6">
<label for="city_zip">City Zip</label>
{{ form.city_zip }}
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
<label for="citizenship">Citizenship</label>
{{ form.citizenship }}
</div>
<div class="form-group col-md-4">
<label for="religion">Religion</label>
{{ form.religion }}
</div>
<div class="form-group col-md-4">
<label for="source_type">Where did you find Halcyon?</label>
{{ form.source_type }}
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
<label for="physical_deformities">Physical Deformities</label>
{{ form.physical_deformities }}
</div>
<div class="form-group col-md-4">
<label for="blood_type">Blood Type</label>
{{ form.blood_type }}
</div>
<div class="form-group col-md-4">
<label for="marital_status">Marrital Status</label>
{{ form.marital_status }}
</div>
</div>
<div class="form-row">
<div class="form-group col-md-3">
<label for="sss">SSS No.</label>
{{ form.sss }}
</div>
<div class="form-group col-md-3">
<label for="tin">TIN No.</label>
{{ form.tin }}
</div>
<div class="form-group col-md-3">
<label for="hdmf">HDMF No.</label>
{{ form.hdmf }}
</div>
<div class="form-group col-md-3">
<label for="phil">Phil health No.</label>
{{ form.phil }}
</div>
</div>
<div class="form-row">
<div class="form-group col-md-3">
<label for="person_emerg_name">Person to notify in case of emergency</label>
{{ form.person_emerg_name }}
</div>
<div class="form-group col-md-3">
<label for="person_emerg_add">Address of the person to notify in case of emergency</label>
{{ form.person_emerg_add }}
</div>
<div class="form-group col-md-3">
<label for="person_emerg_zip">Zip Code</label>
{{ form.person_emerg_zip }}
</div>
<div class="form-group col-md-3">
<label for="person_emerg_contact_no">Contact No.</label>
{{ form.person_emerg_contact_no }}
</div>
</div>
<div class="form-row">
<div class="form-group col-md-3">
<label for="tax_status">Tax Status</label>
{{ form.tax_status }}
</div>
</div>
</div>
<button id="next_family">Next</button>
<input type="submit" value="submit">
</form>
</div>
<div id="family_info">
<div class="container">
<div class="form-row">
<div class="form-group col-md-2">
<label for="firstname">Spouse Last Name</label>
{{form.spouse_last_name}}
</div>
<div class="form-group col-md-2">
<label for="middlename">Spouse First Name</label>
{{form.spouse_first_name}}
</div>
<div class="form-group col-md-2">
<label for="lastname">Spouse Middle Name</label>
{{form.spouse_middle_name}}
</div>
<div class="form-group col-md-2">
<label for="emailadd">Occupation</label>
{{form.spouse_occupation}}
</div>
<div class="form-group col-md-1">
<label for="contact">Age</label>
{{form.spouse_age}}
</div>
<div class="form-group col-md-2">
<label for="contact">Spouse Tel No:</label>
{{form.spouse_telno}}
</div>
</div>
<div class="form-row">
<div class="form-group col-md-2">
<label for="firstname">Father Last Name</label>
{{form.father_last_name}}
</div>
<div class="form-group col-md-2">
<label for="middlename">Father First Name</label>
{{form.father_first_name}}
</div>
<div class="form-group col-md-2">
<label for="lastname">Father Middle Name</label>
{{form.father_middle_name}}
</div>
<div class="form-group col-md-2">
<label for="emailadd">Occupation</label>
{{form.father_occupation}}
</div>
<div class="form-group col-md-1">
<label for="contact">Age</label>
{{form.father_age}}
</div>
<div class="form-group col-md-2">
<label for="contact">Father Tel No.</label>
{{form.father_telno}}
</div>
</div>
<div class="form-row">
<div class="form-group col-md-2">
<label for="firstname">Mother Last Name</label>
{{form.mother_last_name}}
</div>
<div class="form-group col-md-2">
<label for="middlename">Mother First Name</label>
{{form.mother_first_name}}
</div>
<div class="form-group col-md-2">
<label for="lastname">Mother Middle Name</label>
{{form.mother_middle_name}}
</div>
<div class="form-group col-md-2">
<label for="emailadd">Occupation</label>
{{form.mother_occupation}}
</div>
<div class="form-group col-md-1">
<label for="contact">Age</label>
{{form.mother_age}}
</div>
<div class="form-group col-md-2">
<label for="contact">Mother Tel No.</label>
{{form.mother_telno}}
</div>
</div>
<div class="form-row">
<div class="form-group col-md-2">
<label for="firstname">Sibling Last Name</label>
{{form.siblings_last_name}}
</div>
<div class="form-group col-md-2">
<label for="middlename">Sibling First Name</label>
{{form.siblings_first_name}}
</div>
<div class="form-group col-md-2">
<label for="lastname">Sibling Middle Name</label>
{{form.siblings_middle_name}}
</div>
<div class="form-group col-md-2">
<label for="emailadd">Occupation</label>
{{form.siblings_occupation}}
</div>
<div class="form-group col-md-1">
<label for="contact">Age</label>
{{form.siblings_age}}
</div>
<div class="form-group col-md-2">
<label for="contact">Sibling Tel No.</label>
{{form.siblings_telno}}
</div>
</div>
<div class="form-row">
<div class="form-group col-md-2">
<label for="firstname">Sibling Last Name</label>
{{form.siblings2_last_name}}
</div>
<div class="form-group col-md-2">
<label for="middlename">Sibling First Name</label>
{{form.siblings2_first_name}}
</div>
<div class="form-group col-md-2">
<label for="lastname">Sibling Middle Name</label>
{{form.siblings2_middle_name}}
</div>
<div class="form-group col-md-2">
<label for="emailadd">Occupation</label>
{{form.siblings2_occupation}}
</div>
<div class="form-group col-md-1">
<label for="contact">Age</label>
{{form.siblings2_age}}
</div>
<div class="form-group col-md-2">
<label for="contact">Sibling Tel No.</label>
{{form.siblings2_telno}}
</div>
</div>
<div class="form-row">
<div class="form-group col-md-2">
<label for="firstname">Sibling Last Name</label>
{{form.siblings3_last_name}}
</div>
<div class="form-group col-md-2">
<label for="middlename">Sibling First Name</label>
{{form.siblings3_first_name}}
</div>
<div class="form-group col-md-2">
<label for="lastname">Sibling Middle Name</label>
{{form.siblings3_middle_name}}
</div>
<div class="form-group col-md-2">
<label for="emailadd">Occupation</label>
{{form.siblings3_occupation}}
</div>
<div class="form-group col-md-1">
<label for="contact">Age</label>
{{form.siblings3_age}}
</div>
<div class="form-group col-md-2">
<label for="contact">Sibling Tel No.</label>
{{form.siblings3_telno}}
</div>
</div>
</div>
<button id="previous_personal">Previous</button>
<button id="next_educational">Next</button>
</div>
<input type="submit" value="submit">
</div>
You need to include everything within the initial <form> tag. At the moment you have the second part of your form outside the <form></form> and so nothing is happening when you submit.
The second set of form fields is not in a <form> so it won't do anything on form submit. You either have to add it to the current form or wrap it in another form tag and handle that submit separately. Some type of ajax might come in handy here or maybe even using partial templates in django and having the partial be a part of the form then if you get a successful response you could show the next form and handle it almost as a completely separate form. When you submit the form you can also check the network tab in your dev tools and click on the request you just sent then go to the param tab and see what params were sent in the form submit and what their values are. I know this isn't a direct answer but hopefully it can help you debug a bit more.