Skip to content

Commit

Permalink
Create input_validate.js
Browse files Browse the repository at this point in the history
  • Loading branch information
nr0728 authored May 17, 2024
1 parent 036ce4f commit bc3bd3a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions assets/js/input_validate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
function validateInput2(event)
{
if(!/^\d{0,2}$/.test(event.target.value)) event.target.value=event.target.value.replace(/[^\d]/g,'').substring(0,2);
}
function validateInput3(event)
{
if(!/^\d{0,3}$/.test(event.target.value)) event.target.value=event.target.value.replace(/[^\d]/g,'').substring(0,3);
}

0 comments on commit bc3bd3a

Please sign in to comment.