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.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Mar 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    JS order form formatting questions.

    Hello fellow programmers. I am currently in a JS class and have become stomped on part of the assignment. If anyone can provide guidance on how to format these order form functions, I will be much appreciative.


    1. Within the <script> tags at the top of the file, create a function named "loadform()" that displays the current date in the formdate field and then moves the cursor focus to the qtyl field and selects it. Hint: Apply both the focus() and select() methods to the qtyl input box, and run the loadform() function when the page is loaded by the browser.

    2. Below the loadform() function, insert a function named total_price that calculates the sum of the numeric values of the sub1 through sub8 fields.

    3. Below the total_price function, create a function named tax_price() that adds the values of the sub1 through sub6 fields and then multiples that total by 0.05. Use the dollars() function to display this value rounded to two decimal places.

    Attached is a word doc of the program so not to blow this thread up. I should be able to complete the rest of the assignment once I have an understanding about the formats. If anymore information is needed, please let me know.
    Attached Files Attached Files

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,247
    Thanks
    203
    Thanked 2,556 Times in 2,534 Posts
    Sorry, we will not do your homework for you. See forum rule #1.5. If you make a substantial effort yourself and post your code here then doubtless someone will help you correct/improve it.

    This student assignment has come up before. See for example http://www.codingforums.com/showthread.php?t=253788 It seems to be rather old. Displaying a value with 2 decimal places is best done with .toFixed(2).

    All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.
    Last edited by Philip M; 03-12-2012 at 09:52 AM.

    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.

  • #3
    New to the CF scene
    Join Date
    Mar 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Philip M View Post
    Sorry, we will not do your homework for you. See forum rule #1.5. If you make a substantial effort yourself and post your code here then doubtless someone will help you correct/improve it.

    This student assignment has come up before. See for example http://www.codingforums.com/showthread.php?t=253788 It seems to be rather old. Displaying a value with 2 decimal places is best done with .toFixed(2).

    All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.
    Please go look up the definition of the word guidance before you come to my post bashing about doing my homework for me. I obviously don't even know where to start or I would have made an effort. However, thank you for posting the previous thread.

  • #4
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Quote Originally Posted by trestokes View Post
    I obviously don't even know where to start or I would have made an effort.
    That's the situation where you definitely need to ask the teacher for help since you either completely missed the class where the material that you are supposed to be using was taught or the teacher did an extremely poor job of explaining it.

    The question that you have specifies a number of things that you are supposed to do that are considered to be extremely poor practice for real scripts and so without knowing exactly what constructs that you were supposed to have learnt how to use in order to create this contrived script it is impossible to advise you on where to start. Only your teacher has sufficient information on the purpose of the question to advise you as to which of the hundreds or thousands of possibilities is the one you are supposed to be using.

    There ismore than one reason why you mneed to have something approximating the answer before you can ask for help in a forum. That there are lots of solutions to any given problem and that most will not use the code you are supposed to have just learnt means that it isn't just that others don't want to help when you haven't at least got part way yourself - its that we can't help because we have no idea of what code you are supposed to know.
    Last edited by felgall; 03-12-2012 at 10:21 PM.
    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.


  •  

    Posting Permissions

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