12-31-2010, 03:49 PM
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]](http://1.bp.blogspot.com/__M5L-C3oo0s/TR1shkAfqVI/AAAAAAAAAKA/CFRNlBO6g7Y/s320/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]](http://1.bp.blogspot.com/__M5L-C3oo0s/TR1shc34mHI/AAAAAAAAAJ4/gO0aUkqeYFE/s320/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]](http://1.bp.blogspot.com/__M5L-C3oo0s/TR1shI3xskI/AAAAAAAAAJw/yBCs2e4pmDw/s320/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]](http://1.bp.blogspot.com/__M5L-C3oo0s/TR1sg4DKX5I/AAAAAAAAAJo/0cun2eomJSQ/s320/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]](http://1.bp.blogspot.com/__M5L-C3oo0s/TR1sgIjpR4I/AAAAAAAAAJg/TdgNfj8iiII/s320/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]
Layout
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).
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).
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).
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.
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]
