-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
65b7036
commit 248bfa4
Showing
1 changed file
with
227 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,227 @@ | ||
|
||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Javascript8</title> | ||
</head> | ||
<style> | ||
table{ | ||
border: none; | ||
} | ||
</style> | ||
<body style="background: radial-gradient(circle at 5.3% 18.2%, rgb(255, 208, 253) 0%, rgb(255, 237, 216) 90%);"> | ||
<h1 style="color:blue;" align="center">Registration form</h1> | ||
<form> | ||
<table style="border-collapse: collapse;" align="center"> | ||
<tr> | ||
<th>First Name </th> | ||
<td><input type="text" id="fname" size="100%" onkeyup="f1()"> | ||
<span id="msg1"></span> | ||
</td> | ||
</tr> | ||
<tr> | ||
<th>Last Name </th> | ||
<td><input type="text" id="lname" size="100%" onkeyup="f2()"> | ||
<span id="msg2"></span> | ||
|
||
</td> | ||
</tr> | ||
<tr> | ||
<th>Email </th> | ||
<td><input type="text" id="email" size="100%" onkeyup="f3()"> | ||
<span id="msg3"></span> | ||
|
||
</td> | ||
|
||
</tr> | ||
<tr> | ||
<th>Password </th> | ||
<td><input type="password" id="pass" size="100%" onkeyup="f4()"> | ||
<span id="msg4"></span> | ||
|
||
</td> | ||
</tr> | ||
<tr> | ||
<th>Re-enter Password </th> | ||
<td><input type="password" id="repass" size="100%" onkeyup="f5()"> | ||
<span id="msg5"></span> | ||
</td> | ||
</tr> | ||
<tr> | ||
<th>Gender: </th> | ||
<td> | ||
<input type="radio" name="gender" size="60%">Male<br> | ||
<input type="radio" name="gender" size="60%">Female | ||
</td> | ||
</tr> | ||
<tr> | ||
<th>Age: </th> | ||
<td><input type="text" id="Age" size="100%" onkeyup="f6()"> | ||
<span id="msg6"></span> | ||
|
||
</td> | ||
</tr> | ||
<tr> | ||
<th>Phone Number </th> | ||
<td><input type="text" id="phone" size="100%" onkeyup="f7()"> | ||
<span id="msg7"></span> | ||
|
||
</td> | ||
</tr> | ||
<tr> | ||
<th>Address </th> | ||
<td><textarea id="address" rows="5" cols="93" onkeyup="f8()"></textarea> | ||
<span id="msg8"></span> | ||
</td> | ||
</tr> | ||
<tr> | ||
<th>State </th> | ||
<td><input type="text" id="state" size="100%" onkeyup="f9()"> | ||
<span id="msg9"></span> | ||
</td> | ||
</tr> | ||
<tr> | ||
<th>Country </th> | ||
<td><select name="country"> | ||
<option value="Choose your country">Choose your country</option> | ||
<option value="India">India</option> | ||
<option value="Australia">Australia</option> | ||
<option value="Japan">Japan</option> | ||
</select></td> | ||
</tr> | ||
<tr> | ||
<th>Languages known </th> | ||
<td> | ||
<input type="checkbox" name="english">English | ||
<input type="checkbox" name="kannada">kannada | ||
<input type="checkbox" name="hindi">Hindi | ||
<input type="checkbox" name="telugu">Telugu | ||
</td> | ||
</tr> | ||
<tr> | ||
<td colspan="2"><input type="checkbox" name="check">Hereby I declare all the given details are true</td> | ||
</tr> | ||
<tr> | ||
<td colspan="2" align="right">Log in to <a href="https://ethnus.com/about/">Ethnus</a> website</td> | ||
</tr> | ||
</table><br> | ||
|
||
<div align="center" ><button name="register" value="Register"style="color:white;background-color:red;border-radius:20px;">REGISTER</button></div> | ||
|
||
</form> | ||
<script> | ||
function f1(){ | ||
var input1=document.getElementById("fname").value; | ||
if(input1.length < 5 ){ | ||
document.getElementById("msg1").innerText="POOR"; | ||
document.getElementById("msg1").style.color="Red"; | ||
} | ||
else{ | ||
document.getElementById("msg1").innerText="GOOD"; | ||
document.getElementById("msg1").style.color="Green"; | ||
} | ||
} | ||
function f2(){ | ||
var input2=document.getElementById("lname").value; | ||
if(input2.length < 5 ){ | ||
document.getElementById("msg2").innerText="POOR"; | ||
document.getElementById("msg2").style.color="Red"; | ||
} | ||
else{ | ||
document.getElementById("msg2").innerText="GOOD"; | ||
document.getElementById("msg2").style.color="Green"; | ||
} | ||
} | ||
function f3(){ | ||
var input3=document.getElementById("email").value; | ||
var reg1=/^([a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})$/; | ||
if(!input3.match(reg1)){ | ||
document.getElementById("msg3").innerText="POOR"; | ||
document.getElementById("msg3").style.color="Red"; | ||
} | ||
else{ | ||
document.getElementById("msg3").innerText="GOOD"; | ||
document.getElementById("msg3").style.color="Green"; | ||
} | ||
|
||
} | ||
function f4(){ | ||
var input4=document.getElementById("pass").value; | ||
|
||
if(input4.length<5){ | ||
document.getElementById("msg4").innerText="POOR"; | ||
document.getElementById("msg4").style.color="Red"; | ||
} | ||
else{ | ||
document.getElementById("msg4").innerText="GOOD"; | ||
document.getElementById("msg4").style.color="Green"; | ||
} | ||
} | ||
function f5(){ | ||
var input5=document.getElementById("repass").value; | ||
var input4=document.getElementById("pass").value; | ||
|
||
if(input5.length<5){ | ||
|
||
document.getElementById("msg5").innerText="POOR OR MISMATCH"; | ||
document.getElementById("msg5").style.color="Red"; | ||
} | ||
else if(input5!=input4){ | ||
document.getElementById("msg5").innerText="POOR OR MISMATCH"; | ||
document.getElementById("msg5").style.color="Red"; | ||
} | ||
else{ | ||
document.getElementById("msg5").innerText="GOOD"; | ||
document.getElementById("msg5").style.color="Green"; | ||
} | ||
} | ||
function f6(){ | ||
var input6=Number(document.getElementById("Age").value); | ||
if(input6>100 || input6<=0){ | ||
document.getElementById("msg6").innerText="POOR"; | ||
document.getElementById("msg6").style.color="Red"; | ||
} | ||
else{ | ||
document.getElementById("msg6").innerText="GOOD"; | ||
document.getElementById("msg6").style.color="Green"; | ||
} | ||
} | ||
function f7(){ | ||
var reg2= /^\d{10}$/; | ||
var input7=document.getElementById("phone").value; | ||
if(!input7.match(reg2)){ | ||
document.getElementById("msg7").innerText="POOR"; | ||
document.getElementById("msg7").style.color="Red"; | ||
}else{ | ||
document.getElementById("msg7").innerText="GOOD"; | ||
document.getElementById("msg7").style.color="Green"; | ||
} | ||
} | ||
function f8(){ | ||
var input8=document.getElementById("address").value; | ||
if(input8.length <=5 ){ | ||
document.getElementById("msg8").innerText="POOR"; | ||
document.getElementById("msg8").style.color="Red"; | ||
} | ||
else{ | ||
document.getElementById("msg8").innerText="GOOD"; | ||
document.getElementById("msg8").style.color="Green"; | ||
} | ||
} | ||
function f9(){ | ||
var input9=document.getElementById("state").value; | ||
if(input9.length<3 ){ | ||
document.getElementById("msg9").innerText="POOR"; | ||
document.getElementById("msg9").style.color="Red"; | ||
} | ||
else{ | ||
document.getElementById("msg9").innerText="GOOD"; | ||
document.getElementById("msg9").style.color="Green"; | ||
} | ||
} | ||
|
||
</script> | ||
</body> | ||
</html> |