Hi @ondesk007
Please try this snippet as a mu-plugin
add_action( 'wp_footer', 'wpmudev_convert_calculation_time', 9999 );
function wpmudev_convert_calculation_time(){
global $post;
if ( is_a( $post, 'WP_Post' ) && !has_shortcode( $post->post_content, 'forminator_form' ) ) {
return;
}
?>
<script type="text/javascript">
jQuery(document).ready(function($) {
setTimeout(function() {
$('.forminator-custom-form').trigger('after.load.forminator');
}, 100);
$(document).on('after.load.forminator', function(e, form_id) {
if( $('#forminator-module-2878').length ) {
$(document).on('input', '#forminator-field-number-1, #forminator-field-number-2', function(){
var val1 = $('#forminator-field-number-1').val();
var val2 = $('#forminator-field-number-2').val();
if( val1 && val2 ) {
var calculated_time = (+val2)/(+val1);
calculated_time = calculated_time.toFixed(2);
var index = calculated_time.lastIndexOf('.');
var before = '';
var after = '';
if (index !== -1) {
before = calculated_time.slice(0, index);
after = calculated_time.slice(index + 1);
after = ((+after)*60)/100;
$('#forminator-field-text-1').val(before+' minutes '+ after + ' seconds');
}
}
});
}
});
});
</script>
<?php
}
In the snippet you need to change the form ID here “#forminator-module-2878”. Also, field IDs are test, so they need to change them if you have different in your form.
ref.: https://www.ads-software.com/support/article/must-use-plugins/
Kind Regards,
Kris