PDA

View Full Version : form.submit is not a function [Break on this error] form.submit();



intro
30 Aug 2010, 8:00 AM
Hi i am having a problem and working 2 day on it and i am little frustrated :)




this.SpremiChgNews.on('click', this.SpremiChgNewsPR, this);


SpremiChgNewsPR: function (){

this.FormChgNews.getForm().submit(
{
url: 'NovostiDB.php',params: { task: "PROMJENA_PODATAKA",id:slekcijaID,idpromjene:slekcijaDOC


},waitMsg: 'Uploading your document...',

failure: function(form, action){
alert('Something went wrong...');
}
});
}

i think it ok but i don know why .

Here is my long code from designer
{
xtype: 'window',
title: 'Promjena Novosti',
width: 876,
layout: 'form',
autoScroll: true,
itemId: 'NovostiCHG',
id: 'NovostiCHG',
items: [
{
xtype: 'form',
padding: 10,
itemId: 'FormChgNews',
autoShow: true,
fileUpload: true,
formId: 'FormChgNews',
autoScroll: true,
paramsAsHash: true,
baseParams: 'PROMJENA_IZBORNIKA_PODATAK',
width: 861,
monitorValid: true,
method: 'POST',
maskDisabled: false,
url: 'NovostiDB.php',
ref: 'FormChgNews',
id: 'FormChgNews',
items: [
{
xtype: 'textfield',
fieldLabel: 'Naziv Hrvatski',
anchor: '100%',
itemId: 'NazivHR',
ref: '../NazivHR',
id: 'NazivHR'
},
{
xtype: 'textfield',
fieldLabel: 'Naziv Engleski',
anchor: '100%',
itemId: 'NazivEN',
ref: '../NazivEN',
id: 'NazivEN'
},
{
xtype: 'hidden',
fieldLabel: 'Upload slike',
anchor: '100%',
inputType: 'file',
autoWidth: true,
labelStyle: '',
itemId: 'FileUpload',
ref: '../FileUpload',
id: 'FileUpload'
},
{
xtype: 'box',
tpl: '',
height: 170,
itemId: 'SlikaPrikaz',
html: '<img id="pic" src=_upload/_news/"\' + Ext.BLANK_IMAGE_URL + \'"\n class="img-contact" style="margin:10px" height="150" />',
width: 812,
ref: '../SlikaPrikaz',
id: 'SlikaPrikaz'
},
{
xtype: 'htmleditor',
anchor: '100%',
height: 150,
fieldLabel: 'Tekst mali hrvatski',
itemId: 'TextHR',
ref: '../TextHR',
id: 'TextHR'
},
{
xtype: 'htmleditor',
anchor: '100%',
height: 150,
fieldLabel: 'Tekst mali Engleski',
itemId: 'TextEN',
ref: '../TextEN',
id: 'TextEN'
},
{
xtype: 'radio',
fieldLabel: 'Odabir veze',
boxLabel: 'Link',
anchor: '100%',
itemId: 'LinkOdabir',
ref: '../LinkOdabir',
id: 'LinkOdabir'
},
{
xtype: 'radio',
boxLabel: 'HTML',
anchor: '100%',
itemId: 'HTMLOdabir',
ref: '../HTMLOdabir',
id: 'HTMLOdabir'
},
{
xtype: 'fieldset',
title: 'Link upis',
style: 'margin-top:20px;',
hidden: true,
itemId: 'LinkSelect',
ref: '../LinkSelect',
id: 'LinkSelect',
items: [
{
xtype: 'textfield',
fieldLabel: 'Link Hrvatski',
anchor: '100%',
itemId: 'LinkHR',
autoShow: true,
ref: '../../LinkHR',
id: 'LinkHR'
},
{
xtype: 'textfield',
fieldLabel: 'Link Engleski',
anchor: '100%',
itemId: 'LinkEN',
autoShow: true,
ref: '../../LinkEN',
id: 'LinkEN'
}
]
},
{
xtype: 'fieldset',
title: 'HTML Upis',
hidden: true,
itemId: 'HTMLSelect',
ref: '../HTMLSelect',
id: 'HTMLSelect'
}
],
bbar: {
xtype: 'toolbar',
ref: '../send',
items: [
{
xtype: 'button',
text: 'Snimite podatke',
itemId: 'SpremiChgNews',
iconAlign: 'right',
menuAlign: 'tr-br?',
type: 'submit',
autoShow: true,
ref: '../../SpremiChgNews',
id: 'SpremiChgNews'
}
]
}
}
]
}

heratech
30 Aug 2010, 10:29 AM
Is your scope correct? Try breaking "this.FormChgNews.getForm().submit" down. e.g


var a = this.FormChgNews;
var b = a.getForm();
b.submit(...

intro
30 Aug 2010, 11:03 AM
i found out what is going on.... it was duplicated name ....uffff after two day working on it:)B)