Apex Form Component

Apex Form Component

Apex Form Component is used to create Forms in Visualforce page. Apex input and output components are added inside <apex:form> Component. It is required to add only one <apex:form> tag instead of adding many form tags. The body of the form determines the data that is displayed and the way it is processed.

Apex Form Component Attributes.

Accept

Accept is an attribute and it’s a string type, the text to display as a tooltip when the user’s mouse pointer hovers over this component.

Accept charset

Its a string type, it’s a comma separated list of characters encoding that a server processing this form can handle.

forceSSLThe form will be submitted using SSL.
onclickA javascript invoked if the onclick event occurs.
ondclickA javascript invoked if the ondblclick event occurs.
targetThis attribute includes target names like “_blank”, “_parent”,”_self” and “_top”.
prependIdIt is a boolean type that specifies whether this form should prepend its ID to the IDS of it child component.

Visualforce page

Output

Apex Form component

Apex Form component supports HTML pass-through attributes using the “html-” prefix. Pass-through attributes are attached to the generated <form> tag. You can add arbitrary attributes to many Visualforce components that are “passed through” to the rendered HTML. This is useful, for example, when using Visualforce with JavaScript frameworks, such as jQuery Mobile, AngularJS, and Knockout, which use data-* or other attributes as hooks to activate framework functions