Results 1 to 7 of 7

Thread: [2.0] TextField inputType password encodes characters from emptyText property

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    8
    Vote Rating
    0
      0  

    Default [2.0] TextField inputType password encodes characters from emptyText property

    If you set up a TextField with inputType = password, value = "" and emptyText = "Some hint to be displayed", emptyText will show up with password chars (*)
    Last edited by pibos; 5 Dec 2007 at 11:08 AM. Reason: missing version number from title

  2. #2
    Ext User
    Join Date
    Mar 2008
    Posts
    65
    Vote Rating
    0
      0  

    Default

    BUMP

  3. #3
    Sencha User
    Join Date
    Oct 2009
    Location
    Cambridge, UK
    Posts
    164
    Vote Rating
    0
      0  

    Default

    OVERBUMP

  4. #4
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    118
      0  

    Default

    You could use this patch (it's for a totally different problem, but it does help).

  5. #5
    Ext JS Premium Member
    Join Date
    May 2008
    Location
    Austria, Vienna
    Posts
    244
    Vote Rating
    2
      0  

    Default

    This is still the case for ExtJS 3.1.0.
    Is there already a workaround?

  6. #6
    Ext JS Premium Member
    Join Date
    Aug 2007
    Location
    ON, Canada
    Posts
    51
    Vote Rating
    0
      0  

    Default

    What I do is add a focus and blur event and implement some logic to switch the input type from password to text.

    i.e. Ext.getDom('txtPassword').type = "text";

  7. #7
    Sencha User
    Join Date
    Aug 2008
    Posts
    4
    Vote Rating
    0
      0  

    Default this works

    I'm no pro, so take this for what it's worth... a dirty solution that works.

    The idea is to toggle the field between inputType text and password. The important settings are: id, enableKeyEvents: true, and adding a listener on the keyup event.

    Code:
    var createAccountPasswordField = new Ext.form.TextField({renderTo:'createAccountPasswordDiv',id: 'createAccountPasswordField',maxLength:15,width:230,tabIndex: 2, emptyText: 'Make it strong!', enableKeyEvents: true, style: "padding-left: 10px; height: 40px; font-size: 20px;",
    					listeners: {
    						keyup: function(){
    							if( createAccountPasswordField.getValue().length > 0 ){
    								Ext.getDom('createAccountPasswordField').type = "password";
    							} else {
    								Ext.getDom('createAccountPasswordField').type = "text";
    							}
    						}
    					}
    				});

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •