Commit 6b26c775 by Madhankumar

mobile number validation

parent face2c7e
......@@ -24,11 +24,11 @@ function Login({ onSubmit }) {
placeholder="Enter Mobile"
type="tel"
required
// onKeyPress={(event) => {
// if (!/[0-9]/.test(event.key)) {
// event.preventDefault();
// }
// }}
onKeyPress={(event) => {
if (!/[0-9]/.test(event.key)) {
event.preventDefault();
}
}}
maxLength={10}
onChange={(e) => setMobile(e.target.value)}
/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment