Assignment 2 Web
Assignment 2 Web
ASSIGNMENT # 2
CODE:
<!DOCTYPE html>
body { }
h1 {
} float: left;
margin-bottom: 5px; }
[type="submit"] {
width: 100px; }
text-align: right;
margin-right: 10px; p{
} {
</style> }
</head> }
<body> }
<script>
function formValidation() }
{ }
{ if(uname.value.match(letters))
if(Validatesem(sem)) {
{ return true;
if(Validateenroll(enroll)) }
{ else
if(Validatecnic(cnic)) {
} {
{ {
if (uname_len == 0 ) reg.focus();
{ return false;
return false; }
return true; }
} function userid_validation(cnic)
} {
{ if (cnic_len == 0 )
{ cnic.focus();
sem.focus(); }
} }
return true; }
} function userid_validation(uemail)
} {
FAIZA SAEED WEB ENGINEERING 02-134181-003
if (uemail_len == 0 ) }
{ else
{ if(sem.value.match(semformat))
FAIZA SAEED WEB ENGINEERING 02-134181-003
{ if(reg.value.match(regformat))
return true; {
} return true;
else }
{ else
} return false;
} }
function Validateenroll(enroll) }
{ else
{ window.location.reload()
} }
else }
enroll.focus();
<li><label for="sem">semester:</label></li>
<li><label for="CNIC">CNIC:</label></li>
<li><label for="email">Email:</label></li>
<li><label for="enroll">Enrollment
No:</label></li>
<h1></h1>
<p></p>
</body>
</html>