Skip to content

Password

Radoslav Georgiev edited this page Oct 21, 2018 · 2 revisions

Purpose

Password fields are similar to the text field (including in their option), but allow users to enter non-visible passwords.

password-field

Options

Placeholder text

Placeholder texts use the HTML5 placeholder attribute in order to show a grayed-out text before there is any user input.

In PHP they are managed by the set_placeholder_text( $text ) method:

Field::create( 'password', 'password' )->set_placeholder_text( 'Enter a safe and secure password' );

Prefix & Suffix

Prefixes and suffixes appear before and after the field respectively.

They are managed through the set_prefix and set_suffix methods of the field, which expect a single string parameter.

Field::create( 'password', 'password' )
	->set_prefix( 'Prefix text' )
	->set_sufix( 'Suffix text' )
Clone this wiki locally