Skip to content
This repository has been archived by the owner on May 15, 2020. It is now read-only.

Button stays disabled until page is refreshed. #2

Closed
thaljef opened this issue Oct 30, 2013 · 8 comments
Closed

Button stays disabled until page is refreshed. #2

thaljef opened this issue Oct 30, 2013 · 8 comments

Comments

@thaljef
Copy link

thaljef commented Oct 30, 2013

This is a very clever UI design -- well done!

I noticed the ladda-button stays disabled indefinitely once clicked. So if you submit a form by clicking a ladda-button, and then navigate back to the page with the form, the button is still disabled. It seems the only way to enable the button is to refresh the page.

@farnott
Copy link

farnott commented Mar 1, 2014

I've just hit a snag which is related to this - I'm using HTML5 built-in validation on my forms and if validation fails, the submit button stays animated and can't be re-clicked once the validation issue has been resolved. Just can't think of a solution - can anyone else? It's such a great shame as I love the animated buttons!

@thaljef
Copy link
Author

thaljef commented Mar 2, 2014

the submit button stays animated and can't be re-clicked once the validation issue has been resolved

I've seen that before too. I seem to recall fixing it by hooking the animation to the OnSubmit event of the form rather than the OnClick event on the button. But in the end, I decided not to use ladda so I don't remember the specifics.

@farnott
Copy link

farnott commented Mar 2, 2014

Well I came up with a solution, not sure it's the best but it works. Have posted it on my blog:

http://www.flemmingarnott.co.uk/blog/html5-form-validation-ladda-buttons-bootstrap-3/

@msurguy
Copy link
Owner

msurguy commented Mar 8, 2014

@thaljef that would be the better way - to attach the event on form submittal instead of on click.

@farnott thanks for posting a solution to that too, nice way to check validation status of the form.

I will update the docs to reflect the best practice of attaching to the submit event.

@msurguy msurguy closed this as completed Mar 8, 2014
@WilliamsDad
Copy link

Hello - I too have started using the ladda-button, but without embedding in a form. Is there a way to overcome the problem with the button being disabled when navigating back to the page.

Thanks for your help.

@tokar
Copy link

tokar commented Aug 3, 2014

@WilliamsDad I found a workarround, just call Ladda.stopAll(); after all calls to Ladda.bind();

@WilliamsDad
Copy link

Thanks @tokar - I've just come back to this (sorry for the delay); your simple, but very affective, workaround is just what I needed. Cheers.

@veapon
Copy link

veapon commented Dec 18, 2014

How about just simply do $('#btn').removeAttr('disabled') ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants