We are selling corrugated boxes. I want to add form to product page (Woocommerce), in which user will input Length, Width and Height. I want to use those input values to make calculations of price of the product. Is it possible to use "result" value of below code, as price of the product, how do I do it?
I asked this in live chat of Woocommerce, they didn't give any solution, other than hiring a developer or using an extension.
<!DOCTYPE html>
<html>
<body>
<form>
<label for="num1">Number 1:</label><br>
<input type="text" id="num1" name="num1"><br>
<label for="num2">Number 2:</label><br>
<input type="text" id="num2" name="num2"><br><br>
<input type="button" value="Add" onclick="addNumbers()">
</form>
<p>The result is:</p>
<p id="result"></p>
<script>
function addNumbers() {
var num1 = parseInt(document.getElementById("num1").value);
var num2 = parseInt(document.getElementById("num2").value);
document.getElementById("result").innerHTML = num1 + num2;
}
</script>
</body>
</html>