I have a text input field, which is populated by PHP at page load.
<?php
$product_price = 10000;
?>
<input type='text' name='product_price' value='<?=$product_price?>' >
I have some JavaScript code that checks if the product price is less than 12000. If it is, I will make an alert.
if(product_price <= 12000){
alert("product price must be above 12000");
}
The alert is working fine, but the problem is if I change the value of the input field product_price to 50000, it is still prompting me to that "product price must be above 12000"
Why the JS is not able to take the value I entered into the field? Why the PHP populated value is not changing?