Bug Tracker

Opened 14 years ago

Closed 14 years ago

#5136 closed bug (invalid)

change type of input field

Reported by: Sn3b Owned by:
Priority: minor Milestone: 1.4
Component: core Version: 1.3.2
Keywords: input type password Cc:
Blocked by: Blocking:

Description

Hi, I tried to change the input type of a field from password to text. I saw many articles online actually remove the field and recreate it on the fly to accomplish that, which I don't understand...

Anyway, I thought a simple $("#field").attr("type", "text/password") would do, but it simply doesn't work where document.getElementById("field").type="text/password" works just fine.

Not sure if it's a bug, as I said most articles (and even my router's embedded website does the same for hiding/showing wifi key) remove the element and recreate it programmatically.

Change History (1)

comment:1 Changed 14 years ago by dmethvin

Resolution: invalid
Status: newclosed

The behavior varies from browser to browser; I know IE won't let you change the type after it's been created so the only cross-browser way is to create a new element.

Note: See TracTickets for help on using tickets.