Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
pixer415 authored May 29, 2024
1 parent 87de593 commit d0c020a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</style>
</head>
<body onload="getP()">
<input autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" type="textbox" id="test" name="turbotex" maxlength="524288" placeholder="">
<input autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" type="textbox" id="test" name="turbotex" maxlength="524288" placeholder="" oninput="do_on_input()">
</body>
<script>
function getP() {
Expand Down Expand Up @@ -102,15 +102,16 @@
}

// listeners
box.addEventListener("change", (e) => {
var currentValue = e.target.value.substring(0, box.getAttribute("maxlength"));
function do_on_input(e) {
var currentValue = e.target.value.substring(0, box.getAttribute("maxlength"));
if (pattrn === null || !pattrn.test(currentValue)) {
e.target.value = lastValue;
} else {
lastValue = currentValue;
}
update();
});
}
box.addEventListener("change", do_on_input);
box.addEventListener("focus", (e) => {
e.target.style.boxShadow = focused;
});
Expand Down

0 comments on commit d0c020a

Please sign in to comment.