From 15dea86f9e915f22b9888a206b8e823b7795548e Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Mon, 13 Apr 2026 08:35:26 +0530 Subject: [PATCH] Added max length of remarks tetx box in approve and hold and reject form --- resources/views/approval/approve-form.blade.php | 15 ++++++++++++++- resources/views/approval/hold-form.blade.php | 15 ++++++++++++++- resources/views/approval/reject-form.blade.php | 15 ++++++++++++++- 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/resources/views/approval/approve-form.blade.php b/resources/views/approval/approve-form.blade.php index 6ab83d3..f582a13 100644 --- a/resources/views/approval/approve-form.blade.php +++ b/resources/views/approval/approve-form.blade.php @@ -24,7 +24,7 @@
- +
@@ -60,6 +60,19 @@ const remark = document.getElementById("remark").value.trim(); const id = document.getElementById("requestId").value; const level = document.getElementById("level").value; + const errorDiv = document.getElementById("remarkError"); + + if (remark == "") { + errorDiv.innerText = "Remark is mandatory."; + errorDiv.style.display = "block"; + return; + } + + if (remark.length > 60) { + errorDiv.innerText = "Remark must be within 60 characters."; + errorDiv.style.display = "block"; + return; + } fetch('/characteristic/approve-save', { method: 'POST', diff --git a/resources/views/approval/hold-form.blade.php b/resources/views/approval/hold-form.blade.php index dc62aab..f549b2c 100644 --- a/resources/views/approval/hold-form.blade.php +++ b/resources/views/approval/hold-form.blade.php @@ -24,7 +24,7 @@
- + @@ -64,6 +64,19 @@ const remark = document.getElementById("remark").value.trim(); const id = document.getElementById("requestId").value; const level = document.getElementById("level").value; + const errorDiv = document.getElementById("remarkError"); + + if (remark == "") { + errorDiv.innerText = "Remark is mandatory."; + errorDiv.style.display = "block"; + return; + } + + if (remark.length > 60) { + errorDiv.innerText = "Remark must be within 60 characters."; + errorDiv.style.display = "block"; + return; + } fetch('/characteristic/hold-save', { method: 'POST', diff --git a/resources/views/approval/reject-form.blade.php b/resources/views/approval/reject-form.blade.php index 0b73069..94d0c14 100644 --- a/resources/views/approval/reject-form.blade.php +++ b/resources/views/approval/reject-form.blade.php @@ -24,7 +24,7 @@
- + @@ -63,6 +63,19 @@ const remark = document.getElementById("remark").value.trim(); const id = document.getElementById("requestId").value; const level = document.getElementById("level").value; + const errorDiv = document.getElementById("remarkError"); + + if (remark == "") { + errorDiv.innerText = "Remark is mandatory."; + errorDiv.style.display = "block"; + return; + } + + if (remark.length > 60) { + errorDiv.innerText = "Remark must be within 60 characters."; + errorDiv.style.display = "block"; + return; + } fetch('/characteristic/reject-save', { method: 'POST', -- 2.49.1