Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

script/language/method to make form calculate a cost?

  • 12-08-2009 1:04pm
    #1
    Closed Accounts Posts: 411 ✭✭


    basicly i am trying to make my own booking page

    I canmake forms no hassle with drop down menus for options and the like but what i can't do is get each input to add or subtract a value from the total field at the bottom

    I'm not asking anyone to do it for me but if you could point me in the direction of what i should be using to achieve this i can google away and figure it out i hope!


Comments

  • Closed Accounts Posts: 18,163 ✭✭✭✭Liam Byrne


    jQuery
    $("select").onchange(function() {
      totalAmount=0;
      $("select").each(function() {
         totalAmount+=parseInt($(this).val());
      });
      $("#totalField").val(totalAmount);
    });
    


Advertisement