David Winalda David Winalda - 6 months ago 38
jQuery Question

Java Script Math Form Dynamic

<div class="form-group">
<input type="text" class="form-control" name="a" placeholder="Nilai Liquiditas"/></div>
<div class="form-group">
<input type="text" class="form-control" name="b" placeholder="Dana Pencairan">
</div>


How to make dynamic form made by other calculation form. The example is
form(name="b") equal form(name="a" divide 2)

Answer

Your question is not clear. But, I could guess what do you need.

$(document).ready(function(){
   $('input[name="a"]').keyup(function(){
      $('input[name="b"]').val(+$('input[name="a"]').val() / 2);
   });
})
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<div class="form-group">
    <input type="text" class="form-control" name="a" placeholder="Nilai Liquiditas"/></div>
    <div class="form-group">
    <input type="text" class="form-control" name="b" placeholder="Dana Pencairan">
</div>