Spaces:
Sleeping
Sleeping
| <html> | |
| <head><title>OTP Validator</title></head> | |
| <body> | |
| <h2>๐ OTP Validator</h2> | |
| <form id="otp-form"> | |
| <input type="text" name="otp" placeholder="Enter OTP" required /> | |
| <button type="submit">Validate</button> | |
| </form> | |
| <div id="result"></div> | |
| <script> | |
| document.getElementById("otp-form").onsubmit = async (e) => { | |
| e.preventDefault(); | |
| const otp = e.target.otp.value; | |
| const res = await fetch("/validate", { | |
| method: "POST", | |
| headers: {"Content-Type": "application/json"}, | |
| body: JSON.stringify({otp}), | |
| }); | |
| const data = await res.json(); | |
| document.getElementById("result").innerText = data.message; | |
| }; | |
| </script> | |
| </body> | |
| </html> | |