Angular UI Components Documentation
The Angular Form builds a form from a JSON template of fields, groups and buttons, with layout and validation. This guide adds the Angular Form (jqxForm) to an app, then shows how to set its options, handle its events and call its methods.
jqwidgets-ngjqwidgets-ng/jqxform 
In an Angular project (to start one, see Getting started with Angular), add the package with the Angular CLI. It asks for a theme and adds the styles to angular.json:
ng add jqwidgets-ng
Components are standalone: add jqxFormModule to the imports of the component that uses it.
import { Component } from '@angular/core';
import { jqxFormModule } from 'jqwidgets-ng/jqxform';
@Component({
selector: 'app-root',
imports: [jqxFormModule],
templateUrl: './app.html'
})
export class App {}
The source of the live Default Functionality demo.
<jqxForm #myForm
[width]='400'
[height]="'auto'"
[template]='template'
[value]='sampleValue'>
</jqxForm>
import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
import { jqxFormModule } from 'jqwidgets-ng/jqxform';
@Component({
imports: [CommonModule, jqxFormModule],
selector: 'app-root',
templateUrl: './app.html'
})
export class App {
columns: Array<jqwidgets.FormTemplateItem> = [
{ type: 'button', text: 'Sign up', width: '90px', columnWidth: '50%', align: 'right' },
{ type: 'button', text: 'Cancel', width: '90px', columnWidth: '50%' }
];
template: Array<jqwidgets.FormTemplateItem> = [
{
bind: 'firstName',
type: 'text',
label: 'First name',
required: true,
labelWidth: '85px',
width: '250px',
info: 'Enter first name',
infoPosition: 'right'
},
{
bind: 'lastName',
type: 'text',
label: 'Last name',
required: true,
labelWidth: '85px',
width: '250px',
info: 'Enter last name',
infoPosition: 'right'
},
{
bind: 'company',
type: 'text',
label: 'Company',
required: false,
labelWidth: '85px',
width: '250px'
},
{
bind: 'address',
type: 'text',
label: 'Address',
required: true,
labelWidth: '85px',
width: '250px'
},
{
bind: 'city',
type: 'text',
label: 'City',
required: true,
labelWidth: '85px',
width: '250px'
},
{
bind: 'state',
type: 'option',
label: 'State',
required: true,
labelWidth: '85px',
width: '250px',
component: 'jqxDropDownList',
options: [
{ value: 'California' },
{ value: 'New York' },
{ value: 'Oregon' },
{ value: 'Illinois' },
{ value: 'Texas' }
]
},
{
bind: 'zip',
type: 'text',
label: 'Zip code',
required: true,
labelWidth: '85px',
width: '250px'
},
{ type: 'blank', rowHeight: '10px' },
{ columns: this.columns }
];
sampleValue: any = {
firstName: 'John',
lastName: 'Scott',
address: '1st Ave SW',
city: 'San Antonio',
state: 'Texas',
zip: '78209'
};
}Options are inputs, bound with [name]="value".
Events are outputs named on plus the event name with a capital first letter. For example, formDataChange:
<jqxForm (onFormDataChange)="onFormDataChange($event)"></jqxForm>
onFormDataChange(event: any): void {
console.log(event.args);
}
Get the component with a signal query and call its methods. For example, val: Sets or gets the value of the object to bind to the form.
<jqxForm #myForm></jqxForm>
import { Component, viewChild } from '@angular/core';
import { jqxFormModule, jqxFormComponent } from 'jqwidgets-ng/jqxform';
@Component({
selector: 'app-root',
imports: [jqxFormModule],
templateUrl: './app.html'
})
export class App {
readonly myForm = viewChild.required<jqxFormComponent>('myForm');
run(): void {
const value = this.myForm().val(value);
console.log(value);
}
}