[jQuery] Re: attr({'type':'hidden'}) in IE6

2007-08-26 Thread Erik Beeson
Why would you need to do that? --Erik On 8/26/07, Minh [EMAIL PROTECTED] wrote: Getting an error when I tried to set a input attribute to hidden in v1.1.2, v.1.1.3.1 and v1.1.4. Using $ (#inputID).attr({'type':'hidden'}) and $ (#inputID).attr(type,hidden).

[jQuery] Re: attr({'type':'hidden'}) in IE6

2007-08-26 Thread Stephan Beal
On Aug 27, 5:49 am, Minh [EMAIL PROTECTED] wrote: Getting an error when I tried to set a input attribute to hidden in v1.1.2, v.1.1.3.1 and v1.1.4. Using $ (#inputID).attr({'type':'hidden'}) and $ (#inputID).attr(type,hidden). Input elements are special cases in that their 'type' setting

[jQuery] Re: attr({'type':'hidden'}) in IE6

2007-08-26 Thread Karl Rudd
It's a quirk of IE, nothing to do with jQuery. It doesn't allow you to change the type of an input element once it's created. The best you could do would be to create a new hidden field and copy across the contents of the visible element. Then delete the visible element. Karl Rudd On 8/27/07,

[jQuery] Re: attr({'type':'hidden'}) in IE6

2007-08-26 Thread Karl Rudd
Actually another is to just hide it using CSS: $(#inputID).hide(); Karl Rudd On 8/27/07, Karl Rudd [EMAIL PROTECTED] wrote: It's a quirk of IE, nothing to do with jQuery. It doesn't allow you to change the type of an input element once it's created. The best you could do would be to

[jQuery] Re: attr({'type':'hidden'}) in IE6

2007-08-26 Thread Erik Beeson
Note that showing and hiding form fields (text fields, buttons, etc) should be done with .show() and .hide() (that is, by changing the display or visibility styles of the element), not by trying to change the type property. --Erik On 8/26/07, Erik Beeson [EMAIL PROTECTED] wrote: Why would you

[jQuery] Re: attr({'type':'hidden'}) in IE6

2007-08-26 Thread Minh
Stephan thanks for the explanations and Karl thanks for the alternative solution. Erik - I have a form and after the user enter a value then it goes through Ajax validation. If it's validated then I need to disabled or hide it so the user can't edit it. Problem with disabled is that when the

[jQuery] Re: attr({'type':'hidden'}) in IE6

2007-08-26 Thread Aaron Heimlich
On 8/26/07, Minh [EMAIL PROTECTED] wrote: If it's validated then I need to disabled or hide it so the user can't edit it. Try using the readonly attribute instead of disabling or hiding it, e.g. $(#inputID).attr(readOnly, true). But I have to ask: Why would you want to do this? -- Aaron

[jQuery] Re: attr({'type':'hidden'}) in IE6

2007-08-26 Thread Erik Beeson
Ajax validation. If it's validated then I need to disabled or hide it so the user can't edit it. Problem with disabled is that when the form is submitted disabled field doesn't get submitted. You can make it read only, and maybe make the text gray so it's a little clearer that it can't be

[jQuery] Re: attr({'type':'hidden'}) in IE6

2007-08-26 Thread Minh
Erik- Nope I'm just looking for a way to stop the user from editing the field. Setting it to readonly is good and the css will be a nice visual cue. Thanks. On Aug 26, 11:19 pm, Erik Beeson [EMAIL PROTECTED] wrote: Ajax validation. If it's validated then I need to disabled or hide it so