Improve input sanitization for split-pdf-by-sections

This commit is contained in:
Ping Lin 2025-08-03 23:32:45 +01:00
parent d9db298bc2
commit 07b3bfa1f3

View File

@ -79,6 +79,12 @@
// Initial draw // Initial draw
updateVisualAid(); updateVisualAid();
// Removes all whitespace characters (spaces, tabs, newlines) as the user types
document.getElementById('pageToSplit').addEventListener('input', function () {
this.value = this.value.replace(/\s+/g, '');;
});
</script> </script>
<br> <br>
<button type="submit" id="submitBtn" class="btn btn-primary" th:text="#{split-by-sections.submit}">Submit</button> <button type="submit" id="submitBtn" class="btn btn-primary" th:text="#{split-by-sections.submit}">Submit</button>