w2ui
Home
Get started
Demos
Docs
Blog
Support
Layout
Grid
Toolbar
Sidebar
Tabs
Form
Popup
Utilities
ver 1.3
ver 1.4
ver 1.5
ver 2.0
Form
Overview
Events
Properties
Methods
Fields
Numeric
Date & Time
Drop Lists
Multi Selects
Upload
Custom
w2form.formHTML
Form HTML template.
String, default = ''
There are four ways you can define form HTML template (in order of preference):
.formURL
- load from server
.formHTML
- define in JavaScript
innerHTML of
.box
auto generated (see
.generateHTML
)
The following example shows how to define HTML template in JavaScript
$('#form').w2form({ name: 'form', style: 'border: 0px; background-color: transparent;', formHTML: '
'+ '
'+ '
First Name
'+ '
'+ '
'+ '
'+ '
'+ '
'+ '
Last Name
'+ '
'+ '
'+ '
'+ '
'+ '
'+ '
Email
'+ '
'+ '
'+ '
'+ '
'+ '
'+ '
'+ '
Reset
'+ '
Save
'+ '
', fields: [ { name: 'first_name', type: 'text', required: true }, { name: 'last_name', type: 'text', required: true }, { name: 'email', type: 'email' } ], record: { first_name : 'John', last_name : 'Doe', email : 'jdoe@email.com' }, actions: { "save": function () { this.validate(); }, "reset": function () { this.clear(); }, } });
You will still need a container #form to render the form.
User Comments
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus