Home » JSF h:form

JSF <h:form> Tag

The <h:form> tag represents an input form. It includes child components that can contain data which is either presented to the user or submitted with the form. It can also include HTML markup to lay out the components on the page.

Note: The h:form tag itself does not perform any layout, its purpose is to collect data and to declare attributes that can be used by other components in the form.


JSF <h:form> Tag Declaration

JSF <h:form> Tag Example:

Output:

JSF H form tag 1

JSF <h:form> Tag attributes:

Attribute Description
accept List of content types that a server processing this form will handle correctly.
class CSS class name for this component.
enctype It is used to submit content to the server. If not specified, the default value is “application/x-www-form-urlencoded”.
id It is an identifier for this component. This id must be unique. You can use it to access HTML element in CSS and JS file.
lang It describes the language used in the generated markup for this component.
rendered It is used to render the component. The default value for this property is true.
onclick It executes Javascript code when a pointer button is clicked over this element.
onsubmit It executes Javascript code when form is submitted.

You may also like