Create an HTML page for Registration Form using CSS
- <html>
- <head>
- <script type="text/javascript">
- function validate()
- {
- var a=document.f1.nm.value;
- var b=document.f1.pw.value;
- var c=document.f1.pwd.value;
- var d=document.f1.mail.value;
- if(a=="")
- {
- alert("Please enter name");
- }
- else if(b=="")
- {
- alert("Please enter password");
- }
- else if(c=="")
- {
- alert("Please enter confirm password");
- }
- else if(d=="")
- {
- alert("Please enter name email");
- }
- else if(d=="@abc")
- {
- alert("Thanks for register us");
- }
- else
- {
- alert("please include a @ in password");
- }
- }
- </script>
- <title> Registration Form </title>
- </head>
- <body bgcolor="skyblue">
- <form name="f1" method="post" onsubmit="validate()">
- <center>
- <table border="4">
- <h2> Registration Form</h2>
- <tr>
- <td>Username*</td><td><input type="text" name="nm" ></td>
- </tr>
- <tr>
- <td>Password*</td><td><input type="password" name="pw"></td>
- </tr>
- <tr>
- <td>Confirm password*</td><td><input type="password" name="pwd"></td>
- </tr>
- <tr>
- <td>Email*</td><td><input type="text" name="mail"></td>
- </tr>
- <tr>
- <td>Contact</td><td><input type="text" name="cnt"></td>
- </tr>
- <tr>
- <td>Age</td><td><input type="text" name="ag"></td>
- </tr>
- <tr>
- <td>Gender</td><td><input type="radio" name="gn">Male<input type="radio" name="gn">Female</td>
- </tr>
- <tr>
- <td>Qualification</td>
- <td>
- <select>
- <option >Select</option>
- <option>MCA</option>
- <option>MBA</option>
- <option>BTech</option>
- <option>BCA</option>
- <option>BBA</option>
- <option>BA</option>
- <option>Bsc.</option>
- </select>
- </td>
- </tr>
- <tr>
- <td>Hobbies</td><td><input type="checkbox">Watch movie<input type="checkbox">Play cricket</td>
- </tr>
- <td>
- <input type="Submit" name="submit" value="submit">
- <input type="button" value="Cancel">
- </td>
- </table>
- </center>
- </form>
- </body>
- </html>
No comments:
Post a Comment