Hi! I'm just getting started with Forms and wondered if someone had some Javascript handy to multiply 2 fields; currency x number = currency. (rate * miles = reimburse). Any assistance would be appreciated!
(Yes.. I've read the "getting started with javascript" page.. it's just not sinking in fast enough for me.)
Here's what I have so far by piecing together some other examples;
$(document).ready(function () { $('form').click(function(){ $('.miles').on('blur', 'input', calculate); function calculate() { var miles = '[id^=Field82\\(]'; var rate = '[id^=Field83\\(]'; var reimburse = '[id^=Field84\\(]'; reimburse = parseNumber($(this).find('.rate input').val()) * parseNumber($(this).find('.miles input').val()); $('.reimburse input').val(reimburse); function parseNumber(n) { var f = parseFloat(n); //Convert to float number. return isNaN(f) ? 0 : f; //treat invalid input as 0; } });