0% found this document useful (0 votes)
12 views

Code 3

Uploaded by

Yogesh YT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Code 3

Uploaded by

Yogesh YT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Code:

<html>
<head>
<style>
*{
box-sizing:border-box;
margin:0;
padding:0;
}
body{
font-family: Arial, sans-serif;
background-color: #fff;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
table {
background-color: #fff;
padding: 20px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
border-radius: 5px;
width: 400px;
}
h2 {
text-align: center;
margin-top: 60px;
display:flex;
}
form {
display: flex;
flex-direction: column;
}
label {
margin-bottom: 5px;
font-weight: bold;
}
input {
padding: 10px;
margin-bottom: 15px;
border: 1px solid #ccc;
border-radius: 3px;
}
button {
padding: 10px;
background-color: #28a745;
color: white;
border: none;
border-radius: 3px;
cursor: pointer;
}
button:hover {
background-color: hotpink;
}
#errorMsg {
color: red;
text-align: center;
margin-top: 10px
}
input .A{
width:700px;
height:100px;
</style
<title> Student Registration Form </title>
<script type="text/javascript">
function validate(){

if(document.myForm.First_Name.value==""){

alert("Please provide First Name !");


document.myForm.First_Name.focus();
return false;
}

if(document.myForm.Last_Name.value==""){

alert("Please provide Last Name !");


document.myForm.Last_Name.focus();
return false;
}

if(document.myForm.Mobile.value==""){
alert("Please provide mobile number !!");
document.myForm.Mobile.focus();
return false;
}

if(document.myForm.Email.value==""){

alert("Please provide valid Email !!");


document.myForm.Email.focus();
return false;
}

if(document.myForm.Password.value==""){

alert("Please Enter Password !!");


document.myForm.Password.focus();
return false;
}
if(document.myForm.state.value==""){

alert("Please Enter State !!");


document.myForm.state.focus();
return false;
}
return(true);
}
</script>
</head>
<body>
<form action = "#" name = "myForm" onSubmit = "return (validate())";>
<table align = "center" cellpadding="9">
<h2> STUDENT REGISTRATION FORM </h2>
<tr>
<td> First Name : </td>
<td>
<input type = "text" name = "First_Name" placeholder="First Name" />
</td>
</tr>

<tr>
<td> Last Name : </td>
<td>
<input type = "text" name ="Last_Name" placeholder="Last Name" />
</td>
</tr>
<tr>
<td> Gender : </td>
<td> Male
<input type="radio" name="Gender" value="male" />
Female
<input type="radio" name="Gender" value="female" />
</td>
</tr>
<tr>
<td> Moblie No. </td>
<td>
<input type="text" name="Mobile" placeholder="Moblie Number" />
</td>
</tr>
<tr>
<td> Email : </td>
<td> <input type="text" name="Email" placeholder="Email Id" />
</td>
</tr>
<tr>
<td> Password : </td>
<td><input type="Password" name="Password" placeholder="Password" />
</td>
</tr>
<tr>
<td> Address : </td>
<td>
<textarea name = "Address" rows="5" cols="20" placeholder="Address" />
</textarea>
</td>
</tr>

<tr>
<td> Country : </td>
<td>
<input type="text" name="Country" value="INDIA" readonly="readonly"/>
</td>
</tr>
<tr>
<td> Select Course :</td> <br>
<td>
Computer<input type="radio" name="Course" value="Computer" />
Mechanical<input type="radio" name="Course" value="Mechanical" />
Civil<input type="radio" name="Course" value="Civil" />
</td>
</tr>
<tr>
<td align="right"> </td>
<td>
<input
type="Submit"
value="Submit"
style="background-color: pink; color: black; padding: 10px 20px; border: none; border-radius:
5px; cursor: pointer;"
/>
</td>
</tr>
</table>
</form>
</body>
</html>

You might also like