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 completely changes how the are created and rendered. (In my opinion, the fact that type=xxx is used, instead of a separate <TAG>, is a design flaw in HTML.) Once an input element's type is set, it cannot feasibly be changed. Consider, for example, changing from type=submit to type=text. What should happen to: a) the onclick handler? b) the onfocus handler? c) should the value of the button now become the value of the text field? d) etc. etc. etc. Obviously, you do not want onclick on a type=text to submit your form. Similarly, changing the other onXXX events could produce weird/ undesired side effects when switching type= between arbitrary types.