Skip to content

Commit

Permalink
no characters in packgen that conflict indexer
Browse files Browse the repository at this point in the history
  • Loading branch information
BeatACVR authored Dec 30, 2024
1 parent e35e390 commit bc8beb8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packgen.html
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,16 @@ <h2>Release Sounds (max 25)</h2>
document.getElementById('releaseFiles').value = '';
document.querySelector('input[name="packType"]:checked').checked = false;
});

document.querySelectorAll('input[type="text"]').forEach(input => {
input.addEventListener('input', (e) => {
const value = e.target.value;
if (!/^[a-zA-Z0-9-_]*$/.test(value)) {
alert('Only alphanumeric characters, dashes (-), and underscores (_) are allowed.');
e.target.value = value.replace(/[^a-zA-Z0-9-_]/g, '');
}
});
});
</script>
</body>
</html>

0 comments on commit bc8beb8

Please sign in to comment.