Bug Tracker

Modify

Ticket #5136 (closed bug: invalid)

Opened 4 years ago

Last modified 4 years ago

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:
Blocking: Blocked by:

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

comment:1 Changed 4 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid

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.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.