I have a form and calculation formula. I need to get my result in inpute string.
my table
<table class="vel_sum_table" style="font-size: 9pt;">
<tr>
<td><?php echo __( 'In package м<sup>2</sup>:', 'wqc' ); ?></td>
<td> <span><?php echo number_format((get_post_meta($post->ID,"_calculatorscript_value",true)),2,",",""); ?> </span>
</td>
</tr>
<tr>
<td><?php echo __( 'Total:', 'wqc' ); ?></td>
<td><input type="text" value="" name="quantity2" id="quantity_product_input" disabled style="border: none;color: #000;font-weight: bold;"/>
</td>
</tr>
</table>
I need to get my result in quantity_product_input
inpute. My script, I think, works. input[name=quantity]
are on the page. It is product page woocommerce.
<script>
jQuery(document).ready(function($){
var pakket_variable = <?php echo $calculatorValue; ?>;
$('input[name=quantity]').on( 'input change', function(){
var productQty = $(this).val() == '' ? 1 : $(this).val();
meterM2 = (pakket_variable * productQty);
$('#quantity_product_input').val(meterM2);
}
}}
</script>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…