
			 		
	var frm = new Ext.FormPanel({               
        frame:true,
        title: 'Service Request',
        bodyStyle:'padding:5px 5px 0',
        width: 500,
        defaults: {width: 230},
        labelWidth: 125,
        defaultType: 'textfield',
        buttonAlign: 'right',

        items: [{
                fieldLabel: 'Name',
                name: 'data[name]',
                allowBlank:false
            },{
                fieldLabel: 'Address',
                name: 'data[address]',
                allowBlank:false
            },{
                fieldLabel: 'Apt #',
                name: 'data[apt_number]'
            }, {
                fieldLabel: 'Phone Number',
                name: 'data[phone_number]',
                allowBlank:false
            }, {
            	xtype: 'textarea',
            	fieldLabel: 'Service Description',
            	name: 'data[service_description]',
            	height: 100,
            	width: 350,
            	allowBlank:false
            },{
            	xtype: 'hidden',
            	name: 'data[loc_id]'
            }            
        ]
        
    });

	
	frm.addButton({
		text: 'Send Request',        						
        handler: function(){
        
        	if ( frm.getForm().isValid()){
	            frm.getForm().submit({
	            	url:'/index.php/home/submit_request', 
	            	waitMsg:'Submitting Request...',
	            	success: function(){ 
	            		Ext.Msg.alert('Status', 'Your request has been successfully submitted.');
	            		frm.getForm().reset(); 
	            	},
	            	failure: function(){ 
	            		Ext.Msg.alert('Error', 'Your request could not be completed. Please try again.'); 
	            	}
	            });
            }
        }        			
	});

    