Commit 075e2300 authored by Deep Dey's avatar Deep Dey

chore: update form ui for new validation and implementation

parent a9d7e8f7
......@@ -350,9 +350,10 @@
<div class="la-invalid-feedback"></div>
</div>
<div class="la-form-group">
<label for="motherOccupation">Occupation and Designation</label>
<label for="motherOccupation">Occupation and Designation <span>*</span></label>
<input type="text" name="motherOccupation" class="la-form-control">
<div class="la-invalid-feedback"></div>
<small>If not working please write Homemaker/Housewife</small>
</div>
<div class="la-form-group">
<label for="motherMonthlyIncome">Monthly Income</label>
......@@ -381,9 +382,9 @@
<div class="la-invalid-feedback"></div>
</div>
<div class="la-form-group">
<img class="image-preview" src="./img/mother.png" alt="mother photo">
<img id="motherImage" class="image-preview" src="./img/mother.png" alt="mother photo">
<label for="motherImage">Mother's Photo</label>
<input id="motherImage" type="file" name="motherImage" class="la-form-control">
<input id="motherImageInput" type="file" name="motherImage" class="la-form-control">
<div class="la-invalid-feedback"></div>
</div>
</div>
......
......@@ -145,48 +145,51 @@ $(document).ready(function () {
$('#application-form').validate({
rules: {
// school: 'required',
// category: 'required',
// fullName: 'required',
// admissionClass: 'required',
// dateOfBirth: 'required',
// nationality: 'required',
// religion: 'required',
// motherTongue: 'required',
// community: 'required',
// maritalStatus: 'required',
// fatherName: 'required',
// fatherEmail: 'required',
// fatherMobile: {
// required: true,
// regex: /^[0-9]{10}$/,
// },
// fatherNationality: 'required',
// fatherReligion: 'required',
// fatherMotherTongue: 'required',
// fatherCommunity: 'required',
// fatherSchoolInfo: 'required',
// fatherOccupation: 'required',
// fatherMonthlyIncome: 'required',
// motherName: 'required',
// motherMobile: {
// regex: /^[0-9]{10}$/,
// },
// motherNationality: 'required',
// motherReligion: 'required',
// motherMotherTongue: 'required',
// motherCommunity: 'required',
// motherSchoolInfo: 'required',
// candidateImage: {
// required: true,
// extension: ['jpg', 'png', 'jpeg', 'svg'],
// fileSize: 1 * 1024 * 1024,
// },
// fatherImage: {
// required: true,
// extension: ['jpg', 'png', 'jpeg', 'svg'],
// fileSize: 1 * 1024 * 1024,
// },
school: 'required',
category: 'required',
fullName: 'required',
admissionClass: 'required',
dateOfBirth: 'required',
nationality: 'required',
religion: 'required',
motherTongue: 'required',
community: 'required',
homeAddress: 'required',
correspondenceAddress: 'required',
maritalStatus: 'required',
fatherName: 'required',
fatherEmail: 'required',
fatherMobile: {
required: true,
regex: /^[0-9]{10}$/,
},
fatherNationality: 'required',
fatherReligion: 'required',
fatherMotherTongue: 'required',
fatherCommunity: 'required',
fatherSchoolInfo: 'required',
fatherOccupation: 'required',
fatherMonthlyIncome: 'required',
motherName: 'required',
motherMobile: {
regex: /^[0-9]{10}$/,
},
motherNationality: 'required',
motherReligion: 'required',
motherMotherTongue: 'required',
motherCommunity: 'required',
motherSchoolInfo: 'required',
motherOccupation: 'required',
candidateImage: {
required: true,
extension: ['jpg', 'png', 'jpeg', 'svg'],
fileSize: 1 * 1024 * 1024,
},
fatherImage: {
required: true,
extension: ['jpg', 'png', 'jpeg', 'svg'],
fileSize: 1 * 1024 * 1024,
},
// motherImage: {
// required: true,
// extension: ['jpg', 'png', 'jpeg', 'svg'],
......@@ -203,29 +206,32 @@ $(document).ready(function () {
religion: 'Please enter the religion',
motherTongue: 'Please enter the mother tongue',
community: 'Please specify the community',
homeAddress: 'Please enter the home address',
correspondenceAddress: 'Please enter the correspondence address',
maritalStatus: 'Please choose an option',
fatherName: "Please enter the father's name",
fatherEmail: "Please enter the father's email",
fatherName: "Please enter father's name",
fatherEmail: "Please enter father's email",
fatherMobile: {
required: "Please enter the father's phone number",
required: "Please enter father's phone number",
regex: 'Please enter a valid phone number',
},
fatherNationality: "Please enter the father's nationality",
fatherReligion: "Please enter the father's religion",
fatherMotherTongue: "Please enter the father's mother tongue",
fatherCommunity: "Please specify the father's community",
fatherSchoolInfo: "Please enter the father's school name",
fatherOccupation: "Please enter the father's occupation",
fatherMonthlyIncome: "Please enter the father's monthly income",
motherName: "Please enter the mother's name",
fatherNationality: "Please enter father's nationality",
fatherReligion: "Please enter father's religion",
fatherMotherTongue: "Please enter father's mother tongue",
fatherCommunity: "Please specify father's community",
fatherSchoolInfo: "Please enter father's school name",
fatherOccupation: "Please enter father's occupation",
fatherMonthlyIncome: "Please enter father's monthly income",
motherName: "Please enter mother's name",
motherMobile: {
regex: 'Please enter a valid phone number',
},
motherNationality: "Please enter the mother's nationality",
motherReligion: "Please enter the mother's religion",
motherMotherTongue: "Please enter the mother's mother tongue",
motherCommunity: "Please specify the mother's community",
motherSchoolInfo: "Please enter the mother's school name",
motherNationality: "Please enter mother's nationality",
motherReligion: "Please enter mother's religion",
motherMotherTongue: "Please enter mother's mother tongue",
motherCommunity: "Please specify mother's community",
motherSchoolInfo: "Please enter mother's school name",
motherOccupation: "Please enter mother's occupation",
candidateImage: {
required: "Candidate's photo is required",
extension: 'Only jpg, jpeg, png, svg files are allowed.',
......@@ -316,6 +322,10 @@ $(document).ready(function () {
var errorElements = [];
// conditional validation on category
if (!formData.get('correspondenceAddress')) {
let correspondenceAddress = formData.get('homeAddress');
reconfiguredFormData.set('correspondenceAddress', correspondenceAddress);
}
if (formData.get('category') === 'Staff Child') {
if (!formData.get('staffDepartment')) {
$('#staffDepartment').addClass('is-invalid');
......@@ -425,10 +435,10 @@ $(document).ready(function () {
}
if (formData.get('motherImage').name == '') {
$('#motherImage').addClass('is-invalid');
$('#motherImage').next('.la-invalid-feedback').html('For Marital Status Married, Please provide mother image');
$('#motherImage').prev('label').addClass('is-invalid');
errorElements.push('#motherImage');
$('#motherImageInput').addClass('is-invalid');
$('#motherImageInput').next('.la-invalid-feedback').html('For Marital Status Married, Please provide mother image');
$('#motherImageInput').prev('label').addClass('is-invalid');
errorElements.push('#motherImageInput');
}
}
......@@ -439,6 +449,6 @@ $(document).ready(function () {
return null;
}
return null;
return reconfigureFormData;
}
});
......@@ -4,7 +4,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>La Martiniere for Girls - Proof of Delivery</title>
<title>Proof of Delivery</title>
<style>
body {
font-family: Arial, sans-serif;
......@@ -93,7 +93,7 @@
<div class="details" id="details"></div>
<div class="footer">
<p>Please quote the reference <span class="email">piklughosh01@gmail.com</span> for further correspondence
<p>Please quote the reference <span class="email"></span> for further correspondence
until such time the admission procedure is under way.</p>
</div>
</div>
......@@ -118,6 +118,7 @@
$('#details').html(userDataHtml);
$('#school').html(userObject.school);
$('.email').html(userObject.fatherEmail);
} else {
$('#details').html('<p>No user data found.</p>');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment