Emily Jackson Skyline Media 234 Oak Street San Francisco CA
Michael Thompson NextGen Tech 412 Maple Ave Austin TX
Sophia Ramirez BlueSky Corp 89 Pine Blvd Seattle WA
Daniel Williams Quantum Dynamics 15 Sunset Road Chicago IL
Olivia Nguyen Visionary Studio 720 Birch Lane Denver CO
James Patel Northwind Inc. 63 Walnut Ave Miami FL
The Form Smart Paste with AI demo of the jQuery Form.
A live JavaScript/jQuery example of jqxForm, the jQWidgets Form component, with its complete source code below. It is one of 7 jqxForm demos for jQuery.
padding property – Gets or sets the jqxForm's padding.value property – Gets or sets the jqxForm's value.template property – Gets or sets the jqxForm's template.enableSmartPaste propertyhideComponent methodTo run it in your own page, load jqx.base.css, a theme and the library files below from npm (npm install jqwidgets-scripts) or the jsDelivr CDN, then add the markup and the script. jQuery is not required: jqxcore.js provides $. Getting started with jqxForm shows the setup step by step.
The page loads jqx.base.css, a theme and these library files: jqxcore.js, jqxbuttons.js, jqxinput.js, jqxlistbox.js, jqxscrollbar.js, jqxpanel.js, jqxdropdownlist.js, jqxform.js.
It also loads helper scripts of this demo site, which are not part of the library: demos.js (getWidth() and other layout helpers).
$(document).ready(function () {
var template = [
{
bind: 'firstName',
type: 'text',
label: 'First name',
required: true,
labelWidth: '80px',
width: '250px',
info: 'Enter first name',
infoPosition: 'right'
},
{
bind: 'lastName',
type: 'text',
label: 'Last name',
required: true,
labelWidth: '80px',
width: '250px',
info: 'Enter last name'
},
{
bind: 'company',
type: 'text',
label: 'Company',
required: false,
labelWidth: '80px',
width: '250px'
},
{
bind: 'address',
type: 'text',
label: 'Address',
required: true,
labelWidth: '80px',
width: '250px'
},
{
bind: 'city',
type: 'text',
label: 'City',
required: true,
labelWidth: '80px',
width: '250px'
},
{
bind: 'state',
type: 'option',
label: 'State',
required: true,
labelWidth: '80px',
width: '250px',
component: 'jqxDropDownList',
options: [
{ value: 'CA' },
{ value: 'NY' },
{ value: 'OR' },
{ value: 'IL' },
{ value: 'TX' }
]
},
{
bind: 'zip',
type: 'text',
label: 'Zip code',
required: true,
labelWidth: '80px',
width: '250px'
},
{
type: 'blank',
rowHeight: '10px'
},
{
columns: [
{
type: 'button',
text: 'Sign up',
width: '90px',
height: '30px',
rowHeight: '40px',
columnWidth: '50%',
align: 'right'
},
{
type: 'button',
text: 'Cancel',
width: '90px',
height: '30px',
rowHeight: '40px',
columnWidth: '50%'
}
]
}
];
var sampleValue = {
firstName: 'John',
lastName: 'Scott',
address: '1st Ave SW',
company: 'N/A',
city: 'San Antonio',
state: 'Texas',
zip: '78209'
};
$('#sampleForm').jqxForm({
template: template,
value: sampleValue,
enableSmartPaste: true,
padding: { left: 10, top: 10, right: 10, bottom: 10 }
});
$('#sampleForm').jqxForm('hideComponent', 'zip');
});
<div id="sampleForm" style="width: 400px; height: auto;"></div>
<div style="position: absolute; bottom: 5px; right: 5px;">
<a href="https://www.jqwidgets.com/" alt="https://www.jqwidgets.com/"><img alt="https://www.jqwidgets.com/" title="https://www.jqwidgets.com/" src="https://www.jqwidgets.com/wp-content/design/i/logo-jqwidgets.png"></a>
</div>