Sponsored Links


Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: CS101 Introduction to Computing Assignment No 3 solution 31 December fall 2010

  1. #1
    Administrator Xpert's Avatar
    Join Date
    May 2010
    Location
    Jhelum
    Posts
    6,228

    Icon14 CS101 Introduction to Computing Assignment No 3 solution 31 December fall 2010

    Sponsored Links1


    You are required to Design HTML layout, validate form fields and manage fields style with the help of JavaScript. (20 Marks)

    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

    Sponsored Links


    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.
    Solution will be uploaded soon
    Attached Files Attached Files

  2. #2
    Administrator Xpert's Avatar
    Join Date
    May 2010
    Location
    Jhelum
    Posts
    6,228
    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
    HTML Code:
    <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>
    Attached Files Attached Files

  3. #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).

  4. #4
    Administrator Xpert's Avatar
    Join Date
    May 2010
    Location
    Jhelum
    Posts
    6,228
    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

  5. #5
    and why bout my other problem
    On clicking ok reset layout to initial state (White background, pointer focus on GPA field).

  6. #6
    means wht bout my other problem

  7. #7
    Administrator Xpert's Avatar
    Join Date
    May 2010
    Location
    Jhelum
    Posts
    6,228
    i am busy right now i will solve it soon.

  8. #8
    Junior Member
    Join Date
    Jan 2011
    Posts
    2

    99 Most urgent

    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.

  9. #9
    Administrator Xpert's Avatar
    Join Date
    May 2010
    Location
    Jhelum
    Posts
    6,228
    ok let see that what is the problem

  10. #10
    Junior Member
    Join Date
    Jan 2011
    Posts
    2

    Icon20 Problem solved

    The problem has been solved. I will submit it after due date.


    Regards,

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 12-08-2014, 03:52 PM
  2. Replies: 3
    Last Post: 11-27-2012, 02:33 AM
  3. CS101 Introduction to Computing first assignment date extended fall 2010
    By Xpert in forum Virtual University Announcenments
    Replies: 0
    Last Post: 11-09-2010, 04:46 PM
  4. Replies: 0
    Last Post: 06-26-2010, 07:32 AM
  5. Replies: 2
    Last Post: 05-15-2010, 06:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
-: Vuhelp Disclaimer :-
None of the files shown here are hosted or transmitted by this server. The links are provided solely by this site's users. The administrator's or staff of Vuhelp.net cannot be held responsible for what its users post, or any other actions of its users. You may not use this site to distribute or download any material when you do not have the legal rights to do so. It is your own responsibility to adhere to these terms. If you have any doubts about legality of content or you have any suspicions, feel free to contact us.
Online Education | JhelumSoft | Jobs