Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CS101 Introduction to Computing Assignment No 3 solution 31 December fall 2010
#1
You are required to Design HTML layout, validate form fields and manage fields style with the help of JavaScript. (20 Marks)

Layout
[Image: cs101%2B1.JPG]
2. Validate Empty Field


If user will submit form without entering any value in GPA. Display warning message.

Change field background color to pink.

On clicking ok reset layout to initial state (White background, pointer focus on GPA field).
[Image: cs101%2B2.JPG]
3. Validate Alphabetic Value
If user will submit form with alphabetic value. Display warning message.

Change field background color to red.

On clicking ok reset layout to initial state (White background, pointer focus on GPA field).
[Image: cs101%2B3.JPG]
4 Validate Range of Value


If user will submit form with value less than 1 and greater than 4. Display warning message.

Change field background color to light sky blue.

On clicking ok reset layout to initial state (White background, pointer focus on GPA field).
[Image: cs101%2B4.JPG]
5. Validate Correct Numeric Value


If user will submit form with value > = 1 and < style="mso-bidi-font-weight:normal">Fair :: You got D grade”.

If user will submit form with value > = 2 and < style="mso-bidi-font-weight:normal">Good :: You got C grade”.

If user will submit form with value > = 3 and < style="mso-bidi-font-weight:normal">Very Good :: You got B grade ”.

If user will submit form with value equal to 4. Display message “Excellent :: You got A grade ”.


Change field background color to lime.
[Image: cs101%2B5.JPG]
6. Validate Find Grades Button


If value is > = 1 and <= 4, on clicking ok jump to www. vu.edu.pk

For any other value or empty field must not jump to www. vu.edu.pk


Hints:

1. For pink color use keyword pink.

2. For red color use keyword red.

3. For light sky blue color use keyword lightskyblue.

4. For lime color use keyword lime.

5. To change field background color use backgroundColor property of style sheet in JavaScript.

6. To set pointer focus on GPA field use JavaScript function focus.
[SIZE="7"]Solution will be uploaded soon[/SIZE]


Attached Files
.doc   Fall 2010_CS101_3.doc (Size: 548.5 KB / Downloads: 703)
Reply
#2
[SIZE="6"]the cs101 assignment code is given below please make a folder cs101 then open notepad and save the code and save as it in to cs101 folder with the extention of .html[/SIZE]
[HTML]<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!");
}
else if(regex1.test(a)==false)
{
document.theform.grd.style.backgroundColor="red";
alert("Please enter numeric value only");
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");
}
else if(document.theform.grd.value>=1 && document.theform.grd.value<2)
{
document.theform.grd.style.backgroundColor="lime";
alert("Fair :: You got D grade");
}
else if(document.theform.grd.value>=2 && document.theform.grd.value<3)
{
document.theform.grd.style.backgroundColor="lime";
alert("Good :: You got C grade");
}
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");
}
else if(document.theform.grd.value=4)
{
document.theform.grd.style.backgroundColor="lime";
alert("Excellent :: You got A grade ");
}

}
</script>
</head>

<body bgcolor="#666666">
<h1 align="center">Your VU-ID Here:: Assignment (CS101)</h1>
<form name="theform">
<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>
[/HTML]


Attached Files
.zip   answer.zip (Size: 772 bytes / Downloads: 303)
Reply
#3
alert("Please enter CGPA!");
its GPA not CGPA i geuss
and cant understand this thing
On clicking ok reset layout to initial state (White background, pointer focus on GPA field).
Reply
#4
app code main kar kar cgpa ko gpa kar den. ab is ko change ker kay hi send kerna hai. so please don't send as it. other wise you will be in trouble
Reply
#5
and why bout my other problem
On clicking ok reset layout to initial state (White background, pointer focus on GPA field).
Reply
#6
means wht bout my other problem
Reply
#7
i am busy right now i will solve it soon.
Reply
#8
1. Plz tell us to reset at initial state of GPA at white background after clicking Ok.
2. Jump to website Virtual University of Pakistan after entering value between 1 & 4 when we click on ok

Plz do as soon as possible bcoz tomorrow is d last date of submission.
Reply
#9
ok let see that what is the problem
Reply
#10
The problem has been solved. I will submit it after due date.


Regards,
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  ACC501 Business Finance Assignment No.1 Fall Semester 28th November 2012 Vuhelper 1 1,976 03-28-2020, 02:07 AM
Last Post: ArleneKline
  CS615-Software Project Management Assignment no 4 -5th Feb 2016 Vuhelper 0 1,677 02-05-2016, 10:11 PM
Last Post: Vuhelper
  Eng301 Business Communication Assignment No 3 due date 11 FEB,2016 Vuhelper 0 1,577 02-05-2016, 09:49 PM
Last Post: Vuhelper
  MGT111 Assignment No.2 Assignment Solution Due date 3rd Feb 2016 Vuhelper 0 1,836 02-03-2016, 05:37 PM
Last Post: Vuhelper
  FIN630 - Investment Analysis & Portfolio Management Solution 3rd Feb 2016 Vuhelper 0 2,252 02-03-2016, 05:34 PM
Last Post: Vuhelper
  MGT101 Financial Accounting Assignment no 2 solution 20th January 2016 Vuhelper 1 3,466 01-23-2016, 05:14 PM
Last Post: Vuhelper
  MCM101 Introduction to Mass Communication Assignment #3 January 2016 Vuhelper 1 1,954 01-23-2016, 05:13 PM
Last Post: Vuhelper
  mcm311 Reporting and subediting Assignment no 3 January 2016 Vuhelper 0 7,444 01-23-2016, 05:09 PM
Last Post: Vuhelper
  MGT602 assignment no 2 Solution due date 25th January 2016 Vuhelper 0 1,657 01-23-2016, 03:53 PM
Last Post: Vuhelper
  MGT602 Assignment no 2 Solution 20th January 2016 Vuhelper 0 7,547 01-20-2016, 06:53 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)