Re: [jQuery] How to make input readonly with jQuery in IE
But I really wanted readonly. This didn't work: $(span.readonly input).attr(readonly, true); But these did. Note the camelCase: $(span.readonly input).attr(readOnly, true); $(span.readonly input).each(function() { this.readOnly = true; }); I think that is one for the attributes fix list? -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How to make input readonly with jQuery in IE
Klaus Hartl schrieb: But I really wanted readonly. This didn't work: $(span.readonly input).attr(readonly, true); But these did. Note the camelCase: $(span.readonly input).attr(readOnly, true); $(span.readonly input).each(function() { this.readOnly = true; }); I think that is one for the attributes fix list? ie: readonly: readOnly? -- Jörn ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How to make input readonly with jQuery in IE
Jörn Zaefferer schrieb: Klaus Hartl schrieb: But I really wanted readonly. This didn't work: $(span.readonly input).attr(readonly, true); But these did. Note the camelCase: $(span.readonly input).attr(readOnly, true); $(span.readonly input).each(function() { this.readOnly = true; }); I think that is one for the attributes fix list? ie: readonly: readOnly? yes! -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How to make input readonly with jQuery in IE
On 10/19/06, Klaus Hartl [EMAIL PROTECTED] wrote: Jörn Zaefferer schrieb: Klaus Hartl schrieb: But I really wanted readonly. This didn't work: $(span.readonly input).attr(readonly, true); But these did. Note the camelCase: $(span.readonly input).attr(readOnly, true); $(span.readonly input).each(function() { this.readOnly = true; }); I think that is one for the attributes fix list? ie: readonly: readOnly? yes! This is now in SVN Rev: 452 and doing $().attr(readonly, true); will work as expected. -- Brandon Aaron ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] How to make input readonly with jQuery in IE
I've found some inconsistent behavior in IE vs. FF and was wondering if someone might know a workaround.I have some form fields, for which the HTML is generated by a template system out of my control. I want to set some of the fields to readonly so I wrap them in a span that has a readonly class. The HTML looks like this: span class=readonlyinput type=textSome text/input/spanI have tried each of the following queries and none of them have the desired effect. Its like they aren't modifying the DOM. $(span.readonly input).attr(readonly, readonly); $(span.readonly input).attr(disabled, disabled); $(span.readonly input).focus(function() { $(this).blur(); });These work (with varying effects) in FF but not in IE. However if I manually put the attributes (or script) on an input field in IE it does work. I know I have the queryright because I did this $(span.readonly input).focus(function() { alert('here'); });and I get a popup when I click on the field.Can anyone help with this?Thanks,-Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How to make input readonly with jQuery in IE
$(span.readonly input).attr(disabled, disabled); Does this work? $(span.readonly input).attr(disabled, true); The XHTML attribute is disabled=disabled but the Javascript property is boolean. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How to make input readonly with jQuery in IE
It isn't as pretty but you could just loop through them and set the property manually. $(span.readonly input).each(function() { this.disabled = true; }); I believe a fix for this is in the works, so that attr would work as you expected. -- Brandon Aaron On 10/18/06, Dave Methvin [EMAIL PROTECTED] wrote: $(span.readonly input).attr(disabled, disabled); Does this work? $(span.readonly input).attr(disabled, true); The XHTML attribute is disabled=disabled but the Javascript property is boolean. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/