Javatpoint Logo
Javatpoint Logo

apex:inputSecret in Visualforce Page

The <apex: inputSecret> is another important component in the Visualforce page that is used for creating an HTML input element of type password.

The HTML pass-through attributes are supported by this component using the "html-" prefix, which will be attached to the generated <input> tag.

The <apex:inputSecret> component has the following attributes:

1. accesskey

The acesskey is a string type attribute that defines the keyboard access key that puts the field in focus.

Syntax

2. alt

The alt is a string-type attribute that defines the field's alternative text description.

Syntax

3. dir

The dir is a string-type attribute used to specify the direction in which the generated HTML component should be used. RTL and LTR are the two possible values for the dir attribute.

Syntax

4. disabled

The disabled is a Boolean type attribute that specifies whether this text box should be displayed in the disabled state or not. By default, its value is set to false.

Syntax

5. id

The id is a string type attribute, i.e., a unique identifier that allows this component to be referenced by other components in the page.

Syntax

6. immediate

The immediate is a Boolean type attribute. If its value is true, the action associated with the component will happen immediately. The function will not process the validation rules associated with the fields on the page.

Syntax

7. label

The label is a string-type attribute used to display text next to the control and reference the control in the error message.

Syntax

8. lang

The lang is a string-type attribute used for specifying the base language used for the generated HTML output. The possible values of this attribute are en and en-US.

Syntax

9. maxlength

The maxlength is an Integer type value that is used to specify the maximum number of characters the user can enter for this field.

Syntax

10. onblur

The onblur is a string-type attribute used to invoke the JavaScript method when the onblur event occurs or simply when the focus moves off the field.

Syntax:

11. onchange

The onchange is a string-type attribute used to invoke the JavaScript method when the onchange event occurs or when the user changes the field's content.

Syntax:

12. onclick

The onclick is a string-type attribute used to invoke the JavaScript method when the onclick event occurs or when the user clicks the field.

Syntax:

13. ondblclick

The ondblclick is a string-type attribute used to invoke the JavaScript method when the ondblclick event occurs or when the user clicks the field twice.

Syntax:

14. onfocus

The onfocus is a string-type attribute used to invoke the JavaScript method when the input event occurs, or the focus is on the field.

Syntax:

15. onkeydown

The onkeydown is a string-type attribute used to invoke the JavaScript method when the onkeydown event occurs or when the user presses a keyboard key.

Syntax:

16. onkeypress

The onkeypress is a string-type attribute used to invoke the JavaScript method when the onkeypress event occurs or when the user holds down or presses a keyboard key.

Syntax:

17. onkeyup

The onkeyup is a string-type attribute used to invoke the JavaScript method when the onkeyup event occurs or when the user releases a keyboard key.

Syntax:

18. onmousedown

The onmousedown is a string-type attribute used to invoke the JavaScript method when the onmousedown event occurs or when the user presses the mouse button.

Syntax:

19. onmousemove

The onmousemove is a string-type attribute used to invoke the JavaScript method when the onmousemove event occurs or when the user moves the mouse pointer.

Syntax:

20. onmouseout

The onmouseout is a string-type attribute used to invoke the JavaScript method when the onmouseout event occurs or when the user moves the mouse pointer away from the field.

Syntax:

21. onmouseover

The onmouseover is a string-type attribute used to invoke the JavaScript method when the onmouseover event occurs or when the user moves the pointer over the input.

Syntax:

22. onmouseup

The onmouseup is a string-type attribute used to invoke the JavaScript method when the onmouseup event occurs or when the user releases the mouse button.

Syntax:

23. onselect

The onselect is a string-type attribute used to invoke the JavaScript method when the onselect event occurs or when the user selects text in the field.

Syntax:

24. readonly

The readonly is a Boolean type attribute that is used for specifying whether this field is rendered as read-only. By default, its value is set to false.

Syntax:

25. redisplay

The redisplay is a Boolean type attribute used to specify whether a previously entered password is rendered in this form or not. By default, its value is set to false.

Syntax:

26. rendered

The rendered is a Boolean type attribute that specifies whether this component needs to be rendered on the page or not. By default, its value is set to true.

Syntax:

27. required

The required is a Boolean type attribute that specifies whether this field is a required field or not. By default, its value is set to false.

Syntax:

28. size

The size is an Integer type attribute used to specify the width of the input field. Width is expressed by the number of characters displayed at a time.

Syntax:

29. style

The style is a string type attribute used to specify the inline CSS style that will be applied for displaying the input component.

Syntax:

30. styleClass

The styleClass is a string type attribute used to specify the style class that will be applied for displaying the input component.

Syntax:

31. tabindex

The tabindex is a string type attribute used to specify the order in which this field is selected compared to other page components when a user presses the Tab key repeatedly. The value of this attribute should be between 0 to 32767.

Syntax:

32. title

The title is a string-type attribute that specifies the text to display as a tooltip when the user's mouse pointer hovers over this component.

Syntax:

33. value

The value is an Object type attribute, i.e., an expression that references the controller class variable associated with this field.

Syntax:

Let's take an example to understand how we can use the <apex:inputSecret> component on the Visualforce page.

ApexInputSecretExample.vfp

ApexInputSecretController.apxc

Output

apex:inputSecret in Visualforce Page





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA