-2

I have 10 input fields when you create a product (= node). I have an input field amount, price & reduction and sell price. So when the field amount, price & reduction are filled in I want to automatically fill in the sell price field.

Is there a module for this or should I just write some javascript to do this?

I've seen the Computed Field but I haven't tried it yet.

1
  • 1
    I think this answer is relevant to your question and may explain the down votes.
    – Felix Eve
    Commented Apr 28, 2014 at 13:49

1 Answer 1

1

you can adopt a method like this

$(document).ready(function(){
    $('#a1').keyup(calculate);
    $('#a2').keyup(calculate);
});
function calculate(e)
{
    $('#a3').val($('#a1').val() * $('#a2').val());
}

using js

1
  • You should use Drupal behaviors.
    – avpaderno
    Commented Apr 29, 2014 at 7:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.