Skip to content

Commit c4c1104

Browse files
committed
fix: username cannot contain any space
1 parent 6c2dfed commit c4c1104

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pages/partials/body.handlebars

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@
107107
<script>
108108
function validateInput() {
109109
const inputField = document.getElementById("username");
110-
if (inputField.value.trim() === "") {
111-
alert("Username cannot be empty or contain only spaces");
110+
if (/\s/.test(inputField.value)) {
111+
alert("Username cannot contain any spaces.");
112112
return false;
113113
}
114114
showLoader();

0 commit comments

Comments
 (0)