var inviteForm = function(){    var forms = {        invite: new Ext.form.FormPanel({            url: '/do_recommend',            method: 'POST',            frame: true,            defaults: {                width: 300,                msgTarget: 'side',                validationEvent: 'blur'            },            labelAlign: 'top',            items: [{                xtype: 'textfield',                name: 'invitername',                fieldLabel: 'Your name',                allowBlank: false            }, {                xtype: 'textfield',                name: 'inviteremail',                fieldLabel: 'Your Email address',                allowBlank: false,                vtype: 'email'            }, {                xtype: 'textfield',                fieldLabel: 'Nonprofit Contact Email Address',                name: 'recipientemail',                allowBlank: false,                vtype: 'email'            }, {                xtype: 'textfield',                name: 'recipientname',                fieldLabel: 'Nonprofit Contact Name',                allowBlank: false            }, {                xtype: 'textfield',                name: 'nonprofitname',                fieldLabel: 'Nonprofit Organization Name',                allowBlank: false            }, {                xtype: 'textfield',                fieldLabel: 'Enter the numbers from the image below',                name: 'captcha',                allowBlank: false,                minLength: 6,                maxLength: 6            }, {                xtype: '',                html: '<img src="/user/captcha"/>'            }],            buttons: [{                iconCls: 'btn-apply',                text: 'Recommend a Nonprofit',                handler: function(){                    this.ownerCt.form.submit({                        waitMsg: 'Sending Message',                        success: function(a, b){                            var confirmationTemplate = new Ext.XTemplate('<tpl for="."><div><h3>Thank You for recommending a nonprofit organization!</h3>', '<p>We\'ve sent them an email on your behalf.  Remember, you can also contact this nonprofit separately and suggest that they register with Buyadate.org.</p>');                            var markup = confirmationTemplate.apply();                            document.getElementById('formContainer').innerHTML = markup;                        }                    });                }            }]        })    };    return {        init: function(){            forms.invite.render('formContainer');        }    };};Ext.onReady(function(){    var iForm = inviteForm();    iForm.init();});