52 users online (2 members and 50 guests)  


  Results 1 to 6 of 6

Related

  1. What would you do in order to be famous?    Forum: General Discussion
    Replies: 6
  2. jmail /asp sort order    Forum: ASP Forum
    Replies: 0
  3. order by date    Forum: PHP Forum
    Replies: 10
  4. php data order    Forum: PHP Forum
    Replies: 1
  5. Replies: 7
  1. #1
    knightjt02's Avatar
    New User

    Status
    Offline
    Join Date
    Jul 2003
    Posts
    22

    Question I need help in setup a order form!

    OK what i would like to do is in my form is to add ( percentages) to it calculates all the State charges. I can't gite it to work in it can anyone help with this?

    Here all the form

    <html>
    <head>
    <title>Sales</title>
    <script language="JavaScript">
    <!--
    function CalcTot(form) {
    var Tickets=(isNaN( parseInt(form.tickets.value) )) ? 0 : parseInt(form.tickets.value);
    var Donation=(isNaN( parseFloat(form.donation.value) )) ? 0 : parseFloat(form.donation.value);
    form.Amount.value = (Tickets*1.00)+Donation;
    }
    -->
    </script>

    </head>
    <body bgcolor="#ffffff">
    <center><table>
    <tr>
    <td>
    <FORM METHOD=POST ACTION="" name="">
    <table border="1" width="100%" bordercolor="#cccccc">
    <tr>
    <td align="center">Total:<br></td>
    <td>
    <INPUT type="text" size="10" name="tickets" onBlur="CalcTot(this.form)"></td>
    </tr>
    <tr>
    <td align="center">Select a State</td>
    <td>
    <select name="donation" onchange="CalcTot(this.form,this)">
    <option>--- Select A State ---<option value="10.00">Over Night<option value="5.00">Next Day</select>
    </tr>
    <tr>
    <td align="center">Total Amount</td>
    <td><INPUT type="text" size="10" name="Amount" readonly></td>
    </tr>

    </table>
    </FORM>
    </td>
    </tr>
    </table>
    </center>
    </body>
    </html>
    Last edited by knightjt02; 08-30-2003 at 12:50 AM.

  2. #2
    Derek's Avatar
    Be Yourself

    Status
    Offline
    Join Date
    Aug 2001
    Location
    St. George, Utah, USA
    Posts
    466
    throwing a page of code at me and telling me you want percentages for it doesn't tell me much. Give me more info on your script, what exactly you want done, how is it submitting how are you getting something back outa the code that you've written? What and where do you want the percentages, just give more details.

  3. #3
    knightjt02's Avatar
    New User

    Status
    Offline
    Join Date
    Jul 2003
    Posts
    22

    Question

    ( percentages) to it calculates all the State charges
    I like to put the (percentages) in the State list when a person Select a State it add (percentages) to the Total Amount of the Price. There for i like to add the (percentages) in the
    <select name="donation" onchange="CalcTot(this.form,this)">
    <option>--- Select A State ---
    ADD (PERCENTAGES) IN HERE<option value="10.00">----
    ADD (PERCENTAGES) IN HERE<option value="5.00">----</select>
    Last edited by knightjt02; 08-16-2003 at 07:12 AM.

  4. #4
    Derek's Avatar
    Be Yourself

    Status
    Offline
    Join Date
    Aug 2001
    Location
    St. George, Utah, USA
    Posts
    466
    Why don't you just automatically add the charges into the price instead of using more code to put it in? Unless I'm getting you wrong.

  5. #5
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel
    Every state will have a different sales tax amount, so what is needed is each state needs a corresponding percentage so when Texas is selected, it inputs the proper sales tax for texas, same for Cali, ohio and tinbuctwo.

    Dave

  6. #6
    Derek's Avatar
    Be Yourself

    Status
    Offline
    Join Date
    Aug 2001
    Location
    St. George, Utah, USA
    Posts
    466
    Oh I was confused cause under the State list it only had two things, and I figured "State of order" rather than "United States"... hola if no one has it by the morning I'll give it a go my skills with more advanced javascript functions only go so far.



Tags for this Thread