I've got an input box and am displaying a form button on focus... then
hiding the form button on blur.  Ideally, I want to display the form
button on focus, but only hide the button if the original contents of
the input box have not changed (put another way... persist the form
button if the quantity has changed).  Can someone help steer me in the
right direction?  This is for a cart checkout page that I am working
on and will provide users a way to update the quantity of an item in
their cart.  Here's the code I am using:

                // flag the document as OK for JS
                $('html').removeClass('nojs');

                //show Update buttons only as necessary
                $('input.qty').each(function()
                {
                        var $qButton = $
(this).siblings('[EMAIL PROTECTED]"image"]');

                        $(this).focus(function()
                        {
                                $qButton.fadeIn(200);
                        });

                        $(this).blur(function()
                        {
                                $qButton.fadeOut(200);
                        });
                });

As you can probably tell, this approach is less than ideal and
provides the user no time to click the update button after a change
has been made.  I can increase the fadeOut duration, but that still
blows.

Thanks for any help you might be able to provide me.

Reply via email to