Instead of trying to change a regular form field to be a password field, I would try creating both a password field and a form field. Set the the password field's hidden and disabled properties to be true (just being hidden does not disable the field) so when you present your form you just have one field. When the user selects the text CheckBox, listen for the 'check' event to show the hidden and disabled password field, and in the same function, show and enable your password field. I use a similar implementation to switch between two grids. I have not tested this code, but this might do what you need.
Code:
onRender: function(ct, position){
GLOBAL.yourForm.superclass.onRender.call(this, ct, position);
this.checkBox.mon(this.checkBox, 'check', this.togglePasswordFields, this);
this.passwordField.hide();
this.passwordField.disable();
},
togglePasswordFields{
this.clearMyFields();//call a function to clear your fields or just do it on the individual fields
if(this.checkBox.getValue()){
this.regularField.hide();
this.regualrField.disable();
this.passwordField.show();
this.passwordField.enable);
}
else{
this.regularField.show();
this.regualrField.enable();
this.passwordField.hide();
this.passwordField.disable();
}
},
Hope this helps.