From 3312b825fce4a8128734becfe5451a9c8ac90b6e Mon Sep 17 00:00:00 2001 From: ArtemB Date: Tue, 29 Aug 2023 17:53:40 +0300 Subject: [PATCH] 0.0.120 error message for wrong data in arrival --- static/js/user_profile.js | 9 ++++++++- templates/blocks/profile/b_new_route.html | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/static/js/user_profile.js b/static/js/user_profile.js index 515d1bf..e4403ea 100644 --- a/static/js/user_profile.js +++ b/static/js/user_profile.js @@ -601,9 +601,16 @@ function checkDate() { var DateEnd = new Date(dateArrival.value); if (DateEnd < DateStart) { - alert("End date cannot be less than Start date."); + // alert("End date cannot be less than Start date."); dateArrival.value = "" + let arrivalDiv = document.getElementById('arrival_div') + let errorMessage = document.createElement('span'); + errorMessage.textContent = "Дата прибытия, не может быть установлена раньше даты отправки" + errorMessage.classList.add('errorlist') + arrivalDiv.appendChild(errorMessage); + + } return true; diff --git a/templates/blocks/profile/b_new_route.html b/templates/blocks/profile/b_new_route.html index cd44ee8..b842e6f 100644 --- a/templates/blocks/profile/b_new_route.html +++ b/templates/blocks/profile/b_new_route.html @@ -76,7 +76,7 @@ {% endif %} -
+