I have an input textbox which is initially disabled.
<input type="text" name="count" id="count" value="0" disabled="true" data-theme="b" />
When I check a radio button i want to enable and focus the textbox, but when i click the radio button it enables the textbox and focuses some other textbox. I think it does not work because the textbox was initially disabled and you can not focus a disabled input.
$(":input[@name='radio']").live('change', function() {
$(":input[@name='count']").removeAttr("disabled").focus();
});
How do I enable the textbox and then focus it?
It appears it was something wrong with the selector … although the text input box got enabled, it did not get focused, while I tried:
But when i tried this, it worked:
I can not explain why this is happening …
Edit:
It has something to the with the selector, because this works too:
but i still can’t understand why using the first selector, the textbox gets enabled, but not focused …