fix/limit age

This commit is contained in:
SowinskiBraeden committed 2025-05-22 11:12:36 -07:00
1 parent 8998283552
commit 7269814501
2 files changed
+4 -1

No files matched your search

+2
View File
@@ -97,6 +97,8 @@
<% let day = typeof(user.dob) == "object" ? user.dob.getDate() + 1 : user.dob.split('-')[2].split('T')[0];%> <% let day = typeof(user.dob) == "object" ? user.dob.getDate() + 1 : user.dob.split('-')[2].split('T')[0];%>
<% let d = new Date(parseInt(year), parseInt(month), parseInt(day)); %> <% let d = new Date(parseInt(year), parseInt(month), parseInt(day)); %>
value="<%= d.getFullYear() + "-" + ("0"+(d.getMonth()+1)).slice(-2) + "-" + ("0" + d.getDate()).slice(-2); %>" value="<%= d.getFullYear() + "-" + ("0"+(d.getMonth()+1)).slice(-2) + "-" + ("0" + d.getDate()).slice(-2); %>"
<% let d1 = new Date(); %>
max="<%= (d1.getFullYear() - 18) + "-" +("0"+(d1.getMonth()+1)).slice(-2) + "-" + ("0" + d1.getDate()).slice(-2); %>"
> >
</div> </div>
<div> <div>
+2 -1
View File
@@ -8,7 +8,8 @@
<form action="/questionnaire" method="post" class="space-y-4"> <form action="/questionnaire" method="post" class="space-y-4">
<div> <div>
<label for="dob" class="block text-sm font-medium text-gray-700">Date of Birth <span class="text-red-500">*</span></label> <label for="dob" class="block text-sm font-medium text-gray-700">Date of Birth <span class="text-red-500">*</span></label>
<input type="date" name="dob" class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm"> <% let d = new Date(); %>
<input max="<%= (d.getFullYear() - 18) + "-" + ("0"+(d.getMonth()+1)).slice(-2) + "-" + ("0" + d.getDate()).slice(-2); %>" type="date" name="dob" class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm">
</div> </div>
<div> <div>
<label for="education" class="block text-sm font-medium text-gray-700">Education <span class="text-red-500">*</span></label> <label for="education" class="block text-sm font-medium text-gray-700">Education <span class="text-red-500">*</span></label>