I am trying to validate a currency value in a shopping cart so that if it is less than $50 it hides the check out button. I have used the same script for min order units and it worked, but not for currency. Code below
<script type="text/javascript">
setTimeout ("checkout()", 10 );
function checkout() {
var tu = document.getElementById('cost').innerHTML;
if (tu < 50) {
document.getElementById('buyvalidation').style.display='none';
document.getElementById('no').style.display='block';
} else {
document.getElementById('buyvalidation').style.display='block';
}
setTimeout ( "checkout()", 10 );
}
</script>
What is the value of
tu?If it has
$and,, you should strip those out.Although it is probably better practice to have a related hidden field that just has the number without any decorations.