bootstrap-add-clear icon indicating copy to clipboard operation
bootstrap-add-clear copied to clipboard

Symbol X and form reset

Open alexspirt opened this issue 9 years ago • 2 comments

If form has a reset button, symbol X does not disappear when button is clicked

See example: http://www.bootply.com/nIZihCQwUq

alexspirt avatar Aug 15 '16 11:08 alexspirt

Unfortunately there really isn't a good way of doing this. When the reset on a form is triggered, I have not seen any event that is triggered on the input itself, thus the 'x' is never removed.

The suggested fix would be to add an event to your reset button that runs something like $("input").addClear("option", "hide") to the inputs being reset.


That being said I have created a branch where the plugin also searches siblings of the input for a reset button and if found, binds to the click event of the reset button.

I don't like this approach because it is extremely reliant on the form being laid out in a simple way. A more complex layout would break the selector. If anyone can come up with a better way, I'm open to suggestions.

gesquive avatar Sep 02 '16 20:09 gesquive

$('.add-clear-x').hide();

qxygene avatar Feb 11 '18 00:02 qxygene