Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 7 of 9 FirstFirst ... 56789 LastLast
Results 91 to 105 of 124
  1. #91
    Regular Coder
    Join Date
    Apr 2013
    Posts
    112
    Thanks
    1
    Thanked 0 Times in 0 Posts
    key word "These are only activated to input values if section B
    How would i do that though ? Basically if section B is filled in then i am able to fill in this part of the FORM and show an alert if not ticked?

  2. #92
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,596
    Thanks
    80
    Thanked 4,630 Times in 4,593 Posts
    What is this hangup you have with showing alerts for everything?

    You should *NEVER* show *ANY* alert, except when debugging.

    How would you do it? You'd put the section in question in a
    Code:
    <div id="maybe" style="display: none;">
       ... stuff that may or may not be shown ...
    </div>
    and if part B is answered according to the conditions you do
    Code:
    document.getElementById("maybe").display = "block";
    And then don't forget to also validate this section is part B is answered in such a way.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  3. #93
    Regular Coder
    Join Date
    Apr 2013
    Posts
    112
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Old Pedant View Post
    What is this hangup you have with showing alerts for everything?

    You should *NEVER* show *ANY* alert, except when debugging.

    How would you do it? You'd put the section in question in a
    Code:
    <div id="maybe" style="display: none;">
       ... stuff that may or may not be shown ...
    </div>
    and if part B is answered according to the conditions you do
    Code:
    document.getElementById("maybe").display = "block";
    And then don't forget to also validate this section is part B is answered in such a way.
    So i put the section in a div right ? And just call that div using getElementById right? And what is display = "block";?
    I still don't get this part " For both of these items appropriate input devices should be selected and it is mandatory to enter values for both." Could you show me an example so it makes things clear i'm not retarded lol i'm just not very programming oriented hence why im asking you a dozen questions..
    Edit - We have to show alerts unfortunately, call my unit co-ordinator a tard
    Last edited by Johnny87auxsm; 05-09-2013 at 10:41 AM.

  4. #94
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,596
    Thanks
    80
    Thanked 4,630 Times in 4,593 Posts
    Nope. Because you didn't show us the specifications for "both of these items". I have no idea what that refers to.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  5. #95
    Regular Coder
    Join Date
    Apr 2013
    Posts
    112
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Page 8 of assignment PDF and last PAGE If highschoolForm.PDF

    Edit had to upload the images as to big to attach here

    1 Screenshot involves the task/form
    2 Screenshot is the javascript referring to the Highschool.pdf u have..


    SS 1

    SS2
    Last edited by Johnny87auxsm; 05-10-2013 at 03:59 AM.

  6. #96
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,596
    Thanks
    80
    Thanked 4,630 Times in 4,593 Posts
    What level JavaScript course *IS* this????

    SURELY it's not a Level 1 course.

    It truly makes no sense that you would have an assignment like this in a Level 1 course. But then we have the anomaly that you are being told to use alert( ) calls, which should be forbidden in anything beyond maybe the first half of a Level1 course.

    I have to tell you, honestly, what you are being asked to do here is not *hard*, but it's certainly something that would take even an experienced JS programmer some measurable amount of time--at least an hour or two, and maybe more--to pull off with 100% compliance to the specs.

    So if this is *NOT* a Level 1 course, then: Why the heck are you, who clearly hasn't yet successfully mastered even the first half of a Level 1 course, taking it? And why is the instructor having you use the "baby" techniques of a Level 1 course? Just makes no sense.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  7. #97
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,302
    Thanks
    203
    Thanked 2,562 Times in 2,540 Posts
    I think this chap has had (more than) enough help with his assignment already. Pretending that other people's work is your own is normally regarded as cheating. Dishonest, in fact.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  8. #98
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,596
    Thanks
    80
    Thanked 4,630 Times in 4,593 Posts
    I shouldn't do this, but here's a *CONCEPT* for you.

    There is no way I can help you with that "if x is completed then do y" stuff, because it makes references to section and subsection numbers that you haven't shown us. So how the heck are we supposed to *GUESS* what they mean?

    At this point, I think it's time for you to withdraw from the course and go take an "introduction to JavaScript" course, which you are sorely lacking.

    But take a look at this and see what I did, just for fun. Oh, an no alert()s !!!

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <title>eoi_form</title>
    <!-- link href="Assign.css" rel ="stylesheet" type="text/css"/ -->
    <style type="text/css">
    p.sectionhead {
        font-weight:bold;
        text-decoration:underline;
    }
    a#tof {
        font-size: x-large;
        font-weight: bold;
        color: red;
        display: none;
    }
    </style>    
    </head>
    
    <body>
    <form id="formtag" method="post" action="http://tl28serv.uws.edu.au/twainfo/form.asp" >
    <ol id="toc">
       	<li><a href="EOI_home.php">Section 1</a></li>
    	<li><a href="options.html">Section 2</a></li>
       	<li><a href="guidelines.html">Section 3</a></li>
       	<li><a href= "eoi_form.html">Section 4</a> </li>
       	<li><a href="contpriv.html">Privacy Statement and Contact Us page </a></li>       
    </ol>
    <h1> Expression of Interest </h1>
    <p class="grey">  Placement in Year 7,2015 in a NSW government school </p>
    <p class="grey">Please read privacy statement before completing this form!</p>
    <p class="sectionhead">Section A - Student Information</p>
    
    <a name="tof" id="tof">Please correct all errors in pink below and resumbit the form.</a>
    
    <table> 
    <tr>
    	<td> Students Family Name </td>
    	<td><input type="text" size="30"  name="fname" /></td>
    </tr>
    <tr>
        <td> Students Given Name </td>
    	<td><input type="text" size="30"  name="gname" /></td> 
    </tr>
    <tr>
        <td> Date of Birth </td>
    	<td><input type="text" size="30"  name="dob" /></td>
    </tr> 
    <tr>
        <td> Gender </td>
        <td><input type="radio" name="gender" value="Male" /> Male &nbsp;&nbsp;&nbsp;	
    	    <input type="radio" name="gender" value="Female" /> Female</td> 
    </tr>
    <tr>
        <td>Student's Address</td>
    	<td><input type="text" size="30"  name="address" /></td>
    </tr>
    <tr>
        <td>City, State, Postal Code</td>
    	<td>
    	    <input type="text" size="30" name="city" />,
    	    <input type="text" size="4" name="state" />,
    	    <input type="text" size="8" name="postalcode" />
    	</td>
    </tr>
    <tr>
        <td>Name of parent / carer</td>
        <td><input type="text" size="30"  name="parent" /></td>
    </tr>
    <tr>
        <td>Work phone number</td>
    	<td><input type="text" size="30"  name="workphone" /></td>
    </tr>
    <tr>
        <td>Home phone number</td>
    	<td><input type="text" size="30"  name="homephone" /></td>
    </tr>
    <tr>
        <td>Mobile phone number</td>
    	<td><input type="text" size="30"  name="mobile" /></td>
    </tr>
    <tr>
        <td>Student's current primary school</td>
    	<td><input type="text" size="30"  name="school" /></td>
    </tr>
    <tr>
        <td>I agree to the terms and conditions set forth herein</td>
    	<td><input type="checkbox"  name="agreed"/>
    	    <i>(you must agree to terms, or the form cannot be submitted)</i></td>
    </tr>
    <tr>
        <td>Print Name</td>
    	<td><input type="text" size="30" name="printname" readonly="readonly" /></td>
    </tr>
    <tr>
        <td>Date:</td>
    	<td><input type="text" name="date1" size="30"   /></td>
    </tr>
    </table>
    
    <p class="sectionhead">Section B - Placement at your local government school</p>
    <p>The designated local schools for your child is:</p>
    <p><textarea rows="8" cols="50" name="designatedLocalSchools"></textarea></p>
    <p>If there are two designated local schools available to your child, 
       please place the school you would like your child to attend first in the above list.</p>
    <br/>
    <p><label>Parent /Carer Signature: <input type="text" name="signature"/></label></p>
    <p><label>Date <input type="text" name="date2" /></label> </p>
    <p><label>Please tick this box if you have another child enrolled at this school 
       <input type="checkbox" name="otherchild"  /> </label> </p>
    
    <p class="sectionhead">Section C - Placement at other government schools</p>
    <p>Other Government school choices include:</p>
    <ul>
        <li>a <span style="font-weight:bold">specialist </span> government school
            will have additional application requirements.</li>
    	<li>a <span style="font-weight:bold"> specific program </span> in a government school. 
    	    Please note that individual schools will have additional application requirements.</li>
    	<li>a <span style="font-weight:bold"> support class </span> through a placement panel 
    	    to cater for students with additional learning and support needs.</li>
    	<li>a <span style="font-weight:bold"> non local </span> government school. 
    	     Please outline your reasons for seeking non-local placement(s) at the bottom of
    	     this page ( and on page 11 if required).</li>
    </ul>
    <p> I wish to seek placement for my child at the following government schools:</p>
    <p><label>Choice 1 school:<input type="text" name="choice1"  /> </label></p>
    <p><label>Choice 2 school:<input type="text" name="choice2"  /> </label></p>
    <p><label>Choice 3 school:<input type="text" name="choice3"  /> </label></p>
    
    <p style="font-weight:bold">Please note that specialist schools, schools with specific 
       programs and placement panels will have additional application requirements.</span>
    You may wish to seek assistance from your primary school principal. 
    </p>
    <p>I understand that if my child is not sucessful in gaining placement in
        one of the above schools, she/he will be placed in the designated local school listed in Section B.</p>
    <p><label>Parent / Carer<input type="text" name="sign"  /> </label>
    <label>Date<input type="text" name="date3"  /> </label></p>
    	
    <p>Only complete information below if you are applying for placement at non-local schools. 
    <span style="font-weight:bold">You do not need to complete this section 
        if you are applying for specialist schools, a specific program in a school or a support class. </span>
    If necessary, you may attach additional information in support of your request for placement at non-local schools. 
    Refer to pages 6 and 7 for further information. </p>
    
    <p><label style="font-weight:bold">Name of Choice 1 school </span> 
       <input type="text" size="30" name="choice1school"  /> </label></p>
    		
    <p>If you are applying for a non-local school for your Choice 1 school, please outline your 
       reasons for seeking placement at this school (refer to school's specific enrolment criteria).</p>	
    <p><textarea rows="8" cols="50" name="nonlocalreasons1"></textarea> </p>	
    
    <p><label><span style="font-weight:bold">Name of Choice 2 school: </span> 
        <input type="text" size="30" name="choice2school"  /> </label></p>
    <p>If you are applying for a non-local school for your Choice 2 school, 
       please outline your reasons for seeking placement at this school 
       (refer to school's specific enrolment criteria)</p>
    <p><textarea rows="8" cols="50" name="nonlocalreasons2"></textarea> </p>	
    		
    <p><label><span style="font-weight:bold">Name of Choice 3 school: </span> 
       <input type="text" size="30" name="choice3school"  /> </label></p>
    <p>If you are applying for a non-local school for your Choice 2 school, 
       please outline your reasons for seeking placement at this school 
       (refer to school's specific enrolment criteria)</p>
    <p><textarea rows="8" cols="50" name="nonlocalreasons3"></textarea> </p>	
    		
    <p class="sectionheader">Section D- Academically selective</p>
    <p><label><input type="checkbox" name="academicschool"  /> 
        I have submitted an application for placement in an academically selective school.
        My child will be sitting for the Selective High School Tests.
        <span style="font-style:italic;">in case your child is not sucessfull in gaining a place in 
        this/these schools(s), please also complete Section B, Section C or Section E on this form.</span>
        </label> </p>
    
    <p class="sectionheader">Section E- Placement not required</p>
    <p>I will not be seeking  to enrol my child in a NSW government school next year. 
    My child will be attending the following school in 2015</p>
    <p><input type="text" name="noenrollment"  /></p>
    <p><label>Parent /Carer <input type="text" name="sig"  /> </label>
    <label>Date <input type="text" name="date4"  /> </label> </p>
    <p>*Provision of this information is not required but would be appreciated.</p>
    
    <p><input type="submit" value="Submit Form" /><input type="reset" value="Reset" /></p>
    
    </form>
    
    <script type="text/javascript">
    var f = document.getElementById("formtag");
    f.parent.onchange = function( )
    {
        f.printname.value = f.signature.value = f.sig.value = f.sign.value = this.value;
        var dt = new Date();
        var dstring = dt.getDate() + "/" + (dt.getMonth()+1) + "/" + dt.getFullYear();
        f.date1.value = f.date2.value = f.date3.value = f.date4.value = dstring;
    }
    
    f.onsubmit = function( )
    {
        var okay = true;
        
        // check student names
        okay &= showOops( f.fname, "tr", nameTest(f.fname.value) );
        okay &= showOops( f.gname, "tr", nameTest(f.gname.value) );
        // parent name: need first and last, at least:
        var parent = f.parent.value.split(" ");
        okay &= showOops( f.parent, "tr", nameTest(parent[0]) && nameTest(parent[parent.length-1]) );
        // check dob
        okay &= showOops( f.dob, "tr", validateDob(f.dob) );
        // ensure terms agreed to
        okay &= showOops( f.agreed, "tr", f.agreed.checked );
        // ensure gender checked
        okay &= showOops( f.gender[0], "tr", f.gender[0].checked || f.gender[1].checked );
        
        document.getElementById("tof").style.display = okay ? "none" : "block";
        if ( ! okay ) location.href = "#tof";
        
        return false;  // for debugging
        return okay;
    }        
    
    function nameTest( val )
    {
        var nre = /^[a-z][a-z\-\']+[a-z]$/i;
        var nokay = nre.test(val);
        return nokay && val.length >= 3;
    }
           
    function showOops( elem, parent, yesno )
    {
        var node = elem;
        while ( node.tagName.toLowerCase() != parent )
        {
            node = node.parentNode;
            if ( node == null ) return; // something wrong!
        }
        node.style.backgroundColor = yesno ? "transparent" : "pink";
        return yesno;
    }
    function validateDob(dob)
    {
    	var dateStr = dob.value;
    	var dateAry = dateStr.split('/');
    	if (3 !== dateAry.length )
            { 
                return false; // date is invalid 
            }
     	var m = Number(dateAry[0]) - 1;
     	var d = Number(dateAry[1]);
     	var y = Number(dateAry[2]);
     	var dt = new Date(y, m, d);
     	if (d !== dt.getDate() || m !== dt.getMonth() || y !== dt.getFullYear()) 
            {
                return false; // month, day or year outside of the valid range
            }
            if  (y < 2001 || y > 2004)
            {
                return false;
            }
    	return true;
    }    
    </script>
    </body>
    </html>
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  9. #99
    Regular Coder
    Join Date
    Apr 2013
    Posts
    112
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Old Pedant View Post
    What level JavaScript course *IS* this????

    SURELY it's not a Level 1 course.

    It truly makes no sense that you would have an assignment like this in a Level 1 course. But then we have the anomaly that you are being told to use alert( ) calls, which should be forbidden in anything beyond maybe the first half of a Level1 course.

    I have to tell you, honestly, what you are being asked to do here is not *hard*, but it's certainly something that would take even an experienced JS programmer some measurable amount of time--at least an hour or two, and maybe more--to pull off with 100% compliance to the specs.

    So if this is *NOT* a Level 1 course, then: Why the heck are you, who clearly hasn't yet successfully mastered even the first half of a Level 1 course, taking it? And why is the instructor having you use the "baby" techniques of a Level 1 course? Just makes no sense.
    Its a MANDATORY university unit, basically its a core unit which needs to be done. You can only do it once you do programming Fundamentals which is c++ so it's alot different lol.. THey're expecting alot from us because the second screenshot thats only one of the tasks, basically if section is filled in then do this. There's about 12 tasks like referring to different sections of the form

  10. #100
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,596
    Thanks
    80
    Thanked 4,630 Times in 4,593 Posts
    All well and good, but given that you are expected to use PHP and JavaScript, shouldn't you have taken introductory courses in those languages before tackling this course?

    You like the pink error display?
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  11. #101
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    It definitely sounds like the course has prerequisites that the OP doesn't have. The JavaScript component definitely appears to assume that the person has done some other JavaScript course beforehand.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  12. #102
    Regular Coder
    Join Date
    Apr 2013
    Posts
    112
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by felgall View Post
    It definitely sounds like the course has prerequisites that the OP doesn't have. The JavaScript component definitely appears to assume that the person has done some other JavaScript course beforehand.
    Yeah im not exactly sure what to do, this is the only web programming course then once we do this, we do ASP.net

  13. #103
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,596
    Thanks
    80
    Thanked 4,630 Times in 4,593 Posts
    Ummm...ASP.NET *is* web programming. Just with a different technology. So clearly this isn't "the only web programming course."
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  14. #104
    Regular Coder
    Join Date
    Apr 2013
    Posts
    112
    Thanks
    1
    Thanked 0 Times in 0 Posts
    i dont think u understood lol , this and next unit doing ASP will be both web programming units but i need to do this as it's a pre requisite.. I need help doing "if this section is filled in" do this..

  15. #105
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,596
    Thanks
    80
    Thanked 4,630 Times in 4,593 Posts
    And I gave you the answer.

    I can't tell from what you showed us what "this section" is or what part "must then be filled in" is.

    But ihere's a VERY SIMPLE EXAMPLE NOT MEANT TO BE EXACTLY WHAT YOU NEED but maybe it will give you the right idea.
    Code:
    Are you a resident of Australia?
    <input type="radio" name="ozzie" value="No" onclick="resident(false);"> No
    <input type="radio" name="ozzie" value="Yes" onclick="resident(true);"> Yes
    ...
    <div id="residentsOnly" style="display: none;">
    Your Australian Postal Code: <input name="postalcode">
    </div>
    ...
    <script type="text/javascript">
    var ozResident = false;
    function resident(yesno)
    {
        ozResident = yesno;
        document.getElementById("residentsOnly").style.display =
            yesno ? "block" : "none"; // show section if is oz resident
    }
    
    ...
    function validateForm( )
    {
        var form = ...
        ...
        if ( ozResident )
        {
            // validate postal code only if person is resident of Australia 
            var pcode = form.postalcode.value;
            ... validate that however you need to ...
       }
       ...
    }
    </script>
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


 
Page 7 of 9 FirstFirst ... 56789 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •