<!-- Hit RUN to see this project in action! This project will auto-refresh as you edit the HTML, CSS and JS. See README.md for more info (including how to disable auto-refresh and install packages). --> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>Replit</title> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <form onsubmit="return data()" > Name <input type = "text" id= "a"> <br> Age <input type = "number" id= "b"> <br> Email <input type = "email" id= "c"> <br> Phone <input type = "number" id= "d"> <br> Password <input type = "text" id= "e"> <br> Re-enter Password <input type = "text" id= "f"> <br> <input type="submit" > </form> <script type="module" src="script.js"></script> </body> </html> function data(){ let a= document.getElementById("a"); let b= document.getElementById("b"); let c= document.getElementById("c"); let d= document.getElementById("d"); let e= document.getElementById("e"); let f= document.getElementById("f"); if(a==""||b==""||c==""||d==""){ alert("all entries are mandatory"); return false; }else if(isNaN(c)){ alert("phone number must be a number"); }else if(blur.length!=10){ alert(" 10 digit phone no is required"); }else if(e!=f){ alert("passwords must be same"); } else{ return true; } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter