Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Disabling form elements: misleading documentation #6528

Closed
popolla opened this issue Sep 28, 2013 · 5 comments
Closed

Disabling form elements: misleading documentation #6528

popolla opened this issue Sep 28, 2013 · 5 comments
Assignees
Labels

Comments

@popolla
Copy link

popolla commented Sep 28, 2013

The current documentation reads: "All jQuery Mobile widgets can be disabled in the markup by adding the standard disabled attribute to the element, just like you would with native controls".
That's mostly untrue for disabled attributes set via JavaScript. For example, the following code doesn't work properly (the form element will be styled as enabled):

var myselect = $( "#selectfoo" );
myselect.prop( "disabled" , true );
myselect.selectmenu( "refresh" );

Same problem if you try to unset the disabled property that way.
Using attr() method instead of prop() makes no difference.

@agcolom
Copy link
Contributor

agcolom commented Sep 28, 2013

@popolla I've just tried your code in context, and this seems to work: http://jsbin.com/aSuSaCo/1/edit
Closing as I don't see a problem here

@agcolom agcolom closed this as completed Sep 28, 2013
@popolla
Copy link
Author

popolla commented Sep 28, 2013

Thanks Anne but your test only works because the disabled property is added before the markup gets enhanced.
The code does not work if executed at any moment after the markup enhancement: http://jsbin.com/aSuSaCo/4/edit
Sorry I didn't point it out clearly. Hope this could still re-open.

@agcolom
Copy link
Contributor

agcolom commented Sep 29, 2013

@popolla thanks for the clarification, and reopening for now.

@agcolom agcolom reopened this Sep 29, 2013
@ghost ghost assigned jaspermdegroot Sep 29, 2013
@jaspermdegroot
Copy link
Contributor

@popolla

Form widgets have a disable and enable method for dynamically setting this. I just searched the text you were referring to and found it in our demos. It continous with mentioning these methods. To make it more clear I will add that those methods should be used to dynamically disable or enable a form element. Thanks for reporting it!

@popolla
Copy link
Author

popolla commented Sep 29, 2013

That's exactly what I meant. Thank you for being so productive on Sunday!

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

No branches or pull requests

3 participants