PDA

View Full Version : Unknown Error



putty
14 May 2008, 3:50 PM
I am getting this error when I am trying to post a form and have no idea what is causing it or how to debug it.



(this.options.method || this.form.method || this.form.el.dom.method || "POST").toUpperCase is not a function - ext-all.js (line 139)This is my form.


//-- Forms -----------------------------------------------------------------------
var diaryForm = new Ext.form.FormPanel({
baseCls: 'x-plain',
labelWidth: 100,
defaultType: 'textfield',
items: [{
xtype:'fieldset',
title: 'When',
autoHeight:true,
anchor: '100%',
items: [{
xtype: 'datefield',
fieldLabel: 'Date',
name: 'date',
format : 'd/m/Y',
allowBlank:false,
helpText: '<b>Start Date</b><br /> Enter the start date of the engagement activity in format (DDMM/YYYY) that this activity happened.',
anchor: '99%'
}]
},{
xtype:'fieldset',
title: 'Diary Category / Grouping Information',
autoHeight:true,
anchor: '100%',
items: [{
xtype: 'combo',
helpText: '<b> Engagement With </b><br /> Please enter Primary Name/s of the person or people you engaged with.',
allowBlank:false,
pageSize:10,
minChars:2,
store: issue,
loadingText: 'Searching...',
displayField:'activity',
valueField:'id',
typeAhead: false,
triggerAction: 'all',
selectOnFocus:true,
fieldLabel: 'Category',
name: 'category',
tpl: resultTpl,
itemSelector: 'div.search-item',
helpText: '<b></b><br />',
anchor: '99%'
},{
xtype:'combo',
fieldLabel: 'Activity',
name: 'activity',
helpText: '<b> Engagement With </b><br /> Please enter Primary Name/s of the person or people you engaged with.',
allowBlank:false,
hideTrigger:true,
typeAhead: true,
selectOnFocus:true,
triggerAction: 'all',
mode: 'local',
valueField:'lable',
displayField: 'lable',
anchor:'99%',
store: new Ext.data.SimpleStore({
fields: ['lable'],
data: [
<?php include('./include/data/list-activity.php'); ?>
]
})
}]
},{
xtype:'fieldset',
title: 'Communication Method and Information',
autoHeight:true,
anchor: '100%',
items: [{
xtype:'combo',
fieldLabel: 'Method',
name: 'method',
helpText: '<b>Communication Method </b><br /> Please enter the method used to collect this information.',
allowBlank:false,
typeAhead: true,
selectOnFocus:true,
hideTrigger:true,
triggerAction: 'all',
mode: 'local',
valueField:'lable',
displayField: 'lable',
anchor:'99%',
store: new Ext.data.SimpleStore({
fields: ['lable'],
data: [
['Email'],
['Fax'],
['Mail'],
['Meeting'],
['Memo'],
['Phone Call'],
['Presentations'],
['Teleconference'],
['Web']
]
})
},{
xtype: 'textfield',
fieldLabel: 'With',
name: 'engaged',
format : 'd/m/Y',
helpText: '<b> Engagement With </b><br /> Please enter Primary Name/s of the person or people you engaged with.',
anchor: '99%'
}]
},{
xtype:'fieldset',
title: 'Diary Entry',
anchor: '100% -245',
items: [{
xtype: 'textfield',
fieldLabel: 'Subject',
name: 'subject',
allowBlank:false,
helpText: '<b> Engagement With </b><br /> Please enter Primary Contact Name/s of the person or people you engaged with.',
anchor: '99%'
},{
xtype: 'textarea',
fieldLabel: 'Outcome',
name: 'outcome',
allowBlank:false,
helpText: '<b>MILESTONES & OUTCOMES</b><br />Please enter all the milestones & outcomes that eventuated.',
anchor: '99% -25'
},{
xtype: 'hidden',
name: 'item',
allowBlank:false,
value: '<?php echo $table; ?>'
},{
xtype: 'hidden',
name: 'item_id',
allowBlank:false,
value: '<?php echo $gid; ?>'
},{
xtype: 'hidden',
name: 'uid',
allowBlank:false,
value:'<?php echo $_SESSION['uid']; ?>'
}]
}]
});

//-- Window --------------------------------------------------------------------

var diaryWindow = new Ext.Window({
layout: 'fit',
height: 450,
width: 400,
bodyStyle:'padding:5px 5px 0',
title: "Upload File",
resizable: false,
items: diaryForm,

buttons:
[{
text: "Submit",
handler: function(){

diaryForm.getForm().submit({
url: '<?php echo _ROOTPATH; ?>include/data/diary-new.php',
waitMsg: 'Processing...',

success: function( form, action ){
diaryWindow.hide();
},
failure: function( form, action ){
Ext.MessageBox.alert ('Failure', 'There was an error submitting this form, please try again later.');
}
});
}
},{
text: "Cancel",
handler: function(){diaryWindow.hide();}
}]


});
Can anyone suggest what would be causing this problem? I have no idea.

Thanks,
Levi

OutpostMM
14 May 2008, 4:07 PM
Add a method to your form.


diaryForm.getForm().submit({
url: '<?php echo _ROOTPATH; ?>include/data/diary-new.php',
method: "POST",
...

putty
18 May 2008, 3:30 PM
Thanks, everything is working now.