Div Question

Hi

I have a rate calculator that when you click the Calculate button, a div displays a message for a few seconds then disappears.
This works great.

However if the Calculate button is clicked again, the div is still hidden.

I need to reset this somehow so each time a calculation is done, it repeats process of displahying the div and then hiding again.

How do I do this?

Link here: http://newfounddisposal.ca/rate-calc/calc.php

If you really want to hide the results div the way you do, then you’d have to make sure to show it again when new data is added to it:

$.post('process-calc.php', $("#myform").serialize(), function(data) {
	var res = $('#results');
	res.html(data);
	res.show();
});

Or, instead of hiding it in the first place, you could just empty it, but leave it visible.

setTimeout(function() {
	$("#results").html(''); // remove the div's data instead of hiding it
}, 10000);