Form with Toolbar

The example below features a simple form with a toolbar. There ar no form buttons, but the actions of the form are mapped to toolbar buttons. First two are placeholder buttons, and second two are mapped to form actions.
First Name:
Last Name:
Comments:
$(function () { $('#form').w2form({ name : 'form', header : 'Form with Toolbar', url : 'server/post', fields : [ { name: 'first_name', type: 'text', required: true }, { name: 'last_name', type: 'text', required: true }, { name: 'comments', type: 'text'} ], toolbar: { items: [ { id: 'bt1', type: 'button', caption: 'Button 1', img: 'icon-folder' }, { id: 'bt2', type: 'button', caption: 'Button 2', img: 'icon-folder' }, { id: 'bt3', type: 'spacer' }, { id: 'bt4', type: 'button', caption: 'Reset', img: 'icon-page' }, { id: 'bt5', type: 'button', caption: 'Save', img: 'icon-page' } ], onClick: function (event) { if (event.target == 'bt4') this.owner.clear(); if (event.target == 'bt5') this.owner.save(); } } }); });