Documentation > CMS Template API Library > Input > ShowPassword(String,String,Int32,Int32,Int32,String,String)

ShowPassword

Adds a password textbox control to the input screen. This features is provided as a convenience for developers. CrownPeak will not be responsible for the security of this password. Template developers will be responsible for handling the security of passwords submitted with this type of text box. Passwords can be handled in the post input template. They can be encrypted before storing or used and cleared depending on the usage. If they are not handled in the post_input, they will be stored in clear text in the asset content properties.

public System.Void ShowPassword(String,String,Int32,Int32,Int32,String,String)

Parameters

NameDescriptionType
label The label of the field when displayed. System.String
fieldName The field name where the value will be stored. System.String
width The # of characters defining the width of the TextBox. System.Int32
minLength Optional: adds the minlength attibute. Default is 8. System.Int32
maxLength Optional: adds the maxlength attibute. System.Int32
helpMessage Optional: help message System.String
popupMessage Optional: The popup help message. System.String

Code Example

C#

Sample:

             		
             // Standard Password Box.  A width of 25 is a good size to allow both the pw box and the confirm box to show on one line.
             Input.ShowPassword("Password","mypassword", 25, 8, 15);
             
             // List of panels
             while(Input.NextPanel("namelist"))
            {
               Input.ShowTextBox("Username","username","", 25, -1,  15);
               Input.ShowPassword("Password","mypassword", 25, 8, 15,"help","popup");
            }
            
             //post_input: encrypt and clear.
             
             List<PanelEntry> panels = context.InputForm.GetPanels("namelist");
             foreach (PanelEntry entry in panels)
             {
                entry["mypassword_enc"] = "ENCRYPTED_VALUE";//TODO: Use your own encryption method here.
                entry["mypassword"] = "";
              }
             
             	

Connect with Crownpeak