Quote:
Originally Posted by acoder
Yes, it should work, see link. I tried some sample code in Firefox and it works fine.
hmmm ... thats right ... i'm sorry! but using this way is a little bit different from my point of view ... until there is a difference between setting an attribute or using a property of an element. the code i provided, simply uses the readonly attribute of the input-element. I didn't know about the 'readOnly' property of the element and of course this works too ... but i think it is good (coding-)practice to use only one way of setting ui-element-states that means use properties OR use attributes (in case they do the 'same') ... i hope you understand what i'm trying to say? the input-element in our example is set to readonly-state through an attribute ... setAttribute it to false will not work ... you have to remove it to enable the widget.
if you prefer to set properties ... than it works fine too ... of course, but it mixes the possibilities and in larger apps this is hard to debug, or to find ... it's only an idea of me and my personal point of view ... you may agree or disagree with it ... ;)
kind regards ...