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 7 of 7
  1. #1
    Regular Coder
    Join Date
    Nov 2006
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts

    make javascript calculate?

    i have a form with a quantity and price text input in a form can i make it calulate the cost in a form text input called toal cost

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Yes.

    What are you wanting us to do? Don't ask questions that can have a yes or no answer. We aren't just going to write the code for you either. What exactly have you done? Have you tried doing this yourself? I'll give you a hint, you will need to use either Number(), parseInt() or parseFloat() on the input from the form in order to calculate it.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Regular Coder
    Join Date
    Nov 2006
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i have created the form and set the input type maxlenth size and gave each input a name, i just need the code that calcualtes it i am a begginer in javascript and only know varabiles

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    So again what have you tried? We aren't here to just give you code especially since you haven't shown us what you have tried to let us know that you even are trying.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    Regular Coder
    Join Date
    Nov 2006
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts
    as i said i am a begginer i tryed the below:
    i have got a text form named quantity and cost
    so i tryed <script type="text/javascript>var cost*quantity i know nothing about javascript i have only just finshed learning html so your help is much appreacited

  • #6
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Do some searching next time: http://www.irt.org/script/1003.htm

    That was in the first search I did on google
    "How to multiply form inputs?"
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #7
    Regular Coder
    Join Date
    Nov 2006
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts
    can anyone help me as the website above code dosen't work and i want it to calculate say i have £1 in one input and the .00 in thge other so it is £1.00 and then times that by the quantity all help i wil be gratefull for i have done the form i just need the piece if code or a link to a site


  •  

    Posting Permissions

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