VUsolutions Transferred to AchiKhasi.com

From December 2011, this blog www.VUsolutions.blogspot.com is transferred to http://achikhasi.com/vu/ . So, you may visit http://achikhasi.com/vu/ for latest study related help.

Back to home VUsolutions

VUsolutions Fans Club [join us for MORE solutions]

VUsolutions on Facebook

CS101 Assignment No. 3 another solution

Wednesday, January 05, 2011 Posted In Edit This
<html>
<head>
<title>Untitled Document</title>
<script type="text/javascript" language="javascript">
function check(numstr)
{
var a=document.getElementById('fid').value;
var regex1=/^[0-9-.]*$/;
if(document.theform.grd.value.length<1)
{

document.theform.grd.style.backgroundColor="pink";
alert("Please enter CGPA!");
document.theform.grd.style.backgroundColor="white";
document.getElementById('fid').focus();
}
else if(regex1.test(a)==false)
{
document.theform.grd.style.backgroundColor="red";
alert("Please enter numeric value only");
document.theform.grd.style.backgroundColor="white";
document.getElementById('fid').focus();
}
else if(document.theform.grd.value>4 || document.theform.grd.value<1)
{
document.theform.grd.style.backgroundColor="lightskyblue";
alert("Numeric Value Must be Between 0 and 4");
document.theform.grd.style.backgroundColor="white";
document.getElementById('fid').focus();
}
else if(document.theform.grd.value>=1 && document.theform.grd.value<2)
{
document.theform.grd.style.backgroundColor="lime";
alert("Fair :: You got D grade");
document.theform.submit();
}
else if(document.theform.grd.value>=2 && document.theform.grd.value<3)
{
document.theform.grd.style.backgroundColor="lime";
alert("Good :: You got C grade");
document.theform.submit();
}
else if(document.theform.grd.value>=3 && document.theform.grd.value<4)
{
document.theform.grd.style.backgroundColor="lime";
alert("Very Good :: You got B grade");
document.theform.submit();
}
else if(document.theform.grd.value=4)
{
document.theform.grd.style.backgroundColor="lime";
alert("Excellent :: You got A grade ");
document.theform.submit();
}

}
</script>
</head>

<body bgcolor="#666666">
<h1 align="center">StudentID :: Assignment 3 (CS101)</h1>
<form name="theform" action="http://www.vu.edu.pk">
<table border="1px" align="center" cellpadding="10px" cellspacing="1px">
<tr>
<td width="46">
CGPA </td>
<td width="199">
<input type="text" width="20px" name="grd" id="fid" />
</td>
</tr>
<tr>
<td>&nbsp;

</td>
<td>
<input type="button" value="Find Grade" onClick="check()"/>
</td>
</tr>
</table>
</form>
</body>
</html>

Back to home VUsolutions

Shaadi.com: Just create ur account & find ur partner or EARN money, its reall & EASY

VUsolutions Followers (Join NOW and Get Extra Benefits)

Install LATEST toolbar having lot of features - GET solutions on Desktop

toolbar powered by Conduit
Caliplus 300x250 NoFlam VitoLiv 468x60 GlucoLo