Skip to content
Advertisement

jQuery change other value if main input form is (on.change)

I am using Laravel and javascript + jQuery then, what I need is if I click the select option value, it will change the other form input based on (count value).

Here is my preview image :

enter image description here

nah if i click the value of select option in “Tipe Biaya” column, it will count jumlah column*biaya operational column then put the result in total column (in One row).

here my Html code:

JavaScript

Here my JavaScript and jQuery

JavaScript

Thank you so much!

Advertisement

Answer

You can get value of jumlah and biaya column using $(this).closest("tr").find.. then simply use .val() to add result inside your total column inputs.

Demo Code :

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement