SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Div Question

  1. #1
    SitePoint Zealot
    Join Date
    Aug 2009
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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

  2. #2
    SitePoint Enthusiast
    Join Date
    Dec 2007
    Location
    Oskarshamn, Sweden
    Posts
    83
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    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:
    Code:
    $.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.
    Code:
    setTimeout(function() {
    	$("#results").html(''); // remove the div's data instead of hiding it
    }, 10000);


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •