Prevent padLength from getting below 1 when generating
This commit is contained in:
parent
de69f9e9b6
commit
0a543a4f33
5
index.js
5
index.js
|
@ -65,6 +65,11 @@ window.onload = () => {
|
|||
document.getElementById('decrypted').innerHTML = output;
|
||||
}
|
||||
|
||||
document.getElementById('padLength').oninput = (event) => {
|
||||
const value = parseInt(event.target.value);
|
||||
if (value < 1) event.target.value = 1;
|
||||
}
|
||||
|
||||
document.getElementById('generatePad').onclick = () => {
|
||||
const input = parseInt(document.getElementById('padLength').value, 10);
|
||||
const output = generatePad(input);
|
||||
|
|
Loading…
Reference in New Issue