When the user focuses on a certain element, I display a save button. On focusout, I remove the save button.
The user can submit the input by either hitting return or click save. When they click the save button, the input loses focus and the save button is removed, thus not registering the click. Can I tell in the focusout, if the save button has been clicked?
Within my focus function I do something like this:
$('#save_button').click(function(){
saveEditingField(this); //save input
$('#save_button').die("click");
});
$('.editing').focusout( function(e) {
$('#isediting').attr('value','false');
$('#edit_controls').remove()
});
I've tried adding a delay to the remove(), but when tabbing between inputs it shows multiple save buttons (while the others are being removed).
Any ideas?
I think you only need a little timeout between focusout and removing/hiding the button.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With