I am looking for assistance in creating a javascript that will hide the fields ‘field1’ ‘field2’ and ‘field3’ if the value contain within a field ‘total’ is less than 34.00 The field total is a variable calculation based on the user selection which works fine, however I can’t get the Show/Hide to functionality to work and need help with a JavaScript.
(I have also been advised it may be required that you use a setTimeout() as the calculation might be done after your JavaScript function) but not sure how to integrate that as well??
Below is my script so far…
<script type=”text/javascript”>
function displayField()
{
if ($(‘#total’).val() < 34)
document.getElementById(‘field1’).style.display=”none”;
document.getElementById(‘field2’).style.display=”none”;
document.getElementById(‘field3’).style.display=”none”;
}
else
{
document.getElementById(‘field1’).style.display=””;
document.getElementById(‘field2’).style.display=””;
document.getElementById(‘field3’).style.display=””;
}
</script>