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 8 of 9 FirstFirst ... 6789 LastLast
Results 106 to 120 of 124
  1. #106
    Regular Coder
    Join Date
    Apr 2013
    Posts
    112
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I cant upload here because files to big, let me know if this works old pedant.. its the assignment.pdf and the highschool.pdf is the stupid form..

    https://www.dropbox.com/s/kr39qr0zz9vzy4w/Archive.zip

  2. #107
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,596
    Thanks
    80
    Thanked 4,631 Times in 4,594 Posts
    I think that it would be fair to say you are in trouble.

    Have you even *STARTED* coding the PHP side of things? Creating the code to store form submissions into a database table, etc.? I get the feeling the answer is "no".

    And clearly you haven't understood the assignment very well.

    Let me point out just one example:
    a11: Mandatory. List of primary schools that are identified as local to
    the entered postcode in a6 should be dynamically generated
    from the database and presented in an appropriate input device
    to be able to select only one value.
    In other words, a11 should be implemented via an HTML <select>.
    You are using just a text box.

    And *PROBABLY* it implies you should use AJAX to create the list of schools, based on the previously entered postal code.

    *****************

    And you apparently didn't even read the instructions, at all, for b1 and b2.

    &&&&&&&&&&&&&&&&&

    And Section 8 of the instructions is saying that you need to create a *COMPLETELY SEPARATE* php (and HTML and JavaScript and CSS) page.

    Forget all about my post where I showed you how to hide then show sections! TOTALLY inapplicable.

    In comments_form.php you will use PHP CODE to generate the <form> and so the PHP code can simply omit the non-required sections, based on what is in the database.

    I just really think you don't understand the complexity of this assignment and you are totally unprepared to complete it. You have only 2 weeks to complete it, and unless you have implemented tons of stuff you haven't shown us, i would guess you are no more than 10% of the way done, and likely not that far.

    In any case, it would take me at least several days to do all that, and I simply don't have time to do it. Not to mention that it would be a complete and utter cheat on your part.

    I think it's time to drop out of the class and try again next year.
    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. #108
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,596
    Thanks
    80
    Thanked 4,631 Times in 4,594 Posts
    p.s.: You have now spent NINE DAYS on this VERY INSIGNIFICANT part of the task. Truly! The JavaScript validation is WAY less than 5% of the entire work. Can you seriously say you can complete 20 times as much in 13 more days?
    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.

  4. #109
    Regular Coder
    Join Date
    Apr 2013
    Posts
    112
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I've done all the PHP mainly, section 6,7,8,9, 11 working on 10 now which is the stupid letter.. Old pedant can u help with page 8 the whole page of javascript ? I don't care about completing the whole assignment i've done about 50% so far if i can get page 8 done then i've done about 85% which is easily enough for me to pass considering i have other units..

    EDIT* No ajax, we're using javascript,html,php ONLY
    Last edited by Johnny87auxsm; 05-13-2013 at 02:51 PM.

  5. #110
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,596
    Thanks
    80
    Thanked 4,631 Times in 4,594 Posts
    Ummm...AJAX *is* JavaScript. Mixed with some server-side system, meaning PHP is well suited for it.

    And I *did* show you how I would do the validation. Back in post #98.
    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.

  6. #111
    Regular Coder
    Join Date
    Apr 2013
    Posts
    112
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Bit complicated , that is post #98 .. He isn't expecting us to do it like that more along the lines of how i've been doing it so far with my alerts etc, remember we arent pro's we're still learning

  7. #112
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,596
    Thanks
    80
    Thanked 4,631 Times in 4,594 Posts
    Fine. Then kill my showOops function and do something like this:
    Code:
    f.onsubmit = function( )
    {
        var errors = "";
        
        // check student names
        if ( ! nameTest(f.fname.value) ) { errors += "\nStudent first name invalid"; }
        if ( ! nameTest(f.gname.value) ) { errors += "\nStudent surname invalid"; }
        // change parent name field into two fields!!
        // first name and last name.  Too hard to validate a single field
        // and then: check parent names
        if ( ! nameTest(f.parentFirst.value) ) { errors += "\nParent first name invalid"; }
        if ( ! nameTest(f.parentLast.value) ) { errors += "\nParent surname invalid"; }
        // check dob
        if ( ! validateDob(f.dob) ) { errors += "\nInvalid date of birth for student"; }
        // ensure terms agreed to
        if ( ! f.agreed.checked ) { errors += "\nYou must agree to the terms and conditions"; }
        // ensure gender checked
        if ( ! f.gender[0].checked && ! f.gender[1].checked ) {
            errors += "\nYou must check the gender of the student"; }
        
        // OTHER VALIDATIONS GO HERE
    
        // and then finally:
        if ( errors != "" ) { alert("Please fix these errors:" + errors );  return false; }
        
        return false;  // for debugging only
        return okay;
    }
    etc. Add in the rest of the needed checks.
    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.

  8. #113
    Regular Coder
    Join Date
    Apr 2013
    Posts
    112
    Thanks
    1
    Thanked 0 Times in 0 Posts
    If im reading your code correct aren't you just display the alerts based on what isnt checked etc ? I need to do page 8 of the assignment where it states " IF section B is filled in" etc .. Heaps confused with that part..
    Last edited by Johnny87auxsm; 05-14-2013 at 05:37 AM.

  9. #114
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,596
    Thanks
    80
    Thanked 4,631 Times in 4,594 Posts
    Quote Originally Posted by Johnny87auxsm View Post
    If im reading your code correct aren't you just display the alerts based on what isnt checked etc ? I need to do page 8 of the assignment where it states " IF section B is filled in" etc .. Heaps confused with that part..
    And I told you: That part should be done in PHP.

    That part applies to the comments_form.php page. And you should just use PHP code to include or not include questions depending on what you find in the database for that student. And, of course, if you *do* include certain questions then you also include the JavaScript to validate them.
    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.

  10. #115
    Regular Coder
    Join Date
    Apr 2013
    Posts
    112
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Old Pedant View Post
    And I told you: That part should be done in PHP.

    That part applies to the comments_form.php page. And you should just use PHP code to include or not include questions depending on what you find in the database for that student. And, of course, if you *do* include certain questions then you also include the JavaScript to validate them.
    Well says on page 8 for the comments_form everything must be validated using javscript old_pedant ?

  11. #116
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,596
    Thanks
    80
    Thanked 4,631 Times in 4,594 Posts
    Yes? And???

    How is that validation any different from the validation in the other form?

    If you mean "how do you know WHAT to validate?" then, again, let the PHP code decide that.
    Code:
    <script type="text/javascript">
    function validateForm( )
    {
        ... js code to validate sections that are always shown ...
    <?php
       if ( $section17mustBeShown )
       {
    ?>
         ... js code for validating section 17 ...
    <?php
      }
      if ( $section33mustBeShown ) 
      {
    ?>
         ... js code for validating section 33 ...
    <?php
      }
      ...
    ?>
        return true; // end of form validation
    }
    </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.

  12. #117
    Regular Coder
    Join Date
    Apr 2013
    Posts
    112
    Thanks
    1
    Thanked 0 Times in 0 Posts
    How would i do this ??
    give me an example, not sure how to focus on which textbox has the error?

    Edit- Image attached
    Attached Thumbnails Attached Thumbnails Anyone help debug my code 100% correct but no alerts?-codeforums-pm.jpg  
    Last edited by Johnny87auxsm; 05-21-2013 at 08:57 AM.

  13. #118
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,596
    Thanks
    80
    Thanked 4,631 Times in 4,594 Posts
    Code:
    var phonebox = document.getElementById("somePhoneNumberBox");
    if ( phonebox.value.indexOf("(02)") != 0 )
    {
        alert("The phone number must begin with (02)");
        phonebox.focus();
        return false;
    }
    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. #119
    Regular Coder
    Join Date
    Apr 2013
    Posts
    112
    Thanks
    1
    Thanked 0 Times in 0 Posts
    old pedant i've done everything except the office use only form which u posted on #post 46 i think it was, basically if the whole section is filled in then blah, but i cant even get them to work and its due in 1 day, the whole page 8 of the assignment.pdf, can i send to you so u can help man ?

  15. #120
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,596
    Thanks
    80
    Thanked 4,631 Times in 4,594 Posts
    You made post #46, not me.

    Try again.
    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 8 of 9 FirstFirst ... 6789 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
  •