tags:

views:

22

answers:

1

I am using the following code to countdown before enabling a button.

<script type="text/javascript">
$.fn.timedDisable = function(time) {
    if (time == null) { time = 5000; }
    return $(this).each(function() {
        $(this).attr('disabled', 'disabled');
        var disabledElem = $(this);
        setTimeout(function() {
            disabledElem.removeAttr('disabled');
        }, time);
    });
};

$(function() {
    $('#btnContinue').timedDisable();
});
</script>

How can I get the button value to read value="Continue (x)", Where x is the number of seconds remaining until it's enabled, after which it's just value="Continue"?

A: 
patrick dw
that works great, thank you
Sam
@Sam - You're welcome. :o)
patrick dw