validation fix

This commit is contained in:
Kakabay 2025-01-16 18:18:23 +05:00
parent 668feb6c79
commit 0d6af89834
1 changed files with 4 additions and 4 deletions

View File

@ -24,7 +24,7 @@ const LotteryAuthForm = () => {
};
const validateCode = (value: string) => {
const codeRegex = /^\d-\d{10}$/;
const codeRegex = /^.+-\d{10}$/; // Any characters before "-", exactly 10 digits after
const isValid = codeRegex.test(value);
console.log('Code Input:', value);
@ -80,9 +80,9 @@ const LotteryAuthForm = () => {
const handleCodeChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const value = e.target.value;
if (value.length <= 12) {
setCode(value);
}
setCode(value);
// if (value.length <= 12) {
// }
};
return (