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).
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
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,
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
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
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
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
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
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
9 matches
Mail list logo