PDA

View Full Version : [2.0b1][CLOSED] Problem with Form submit



gizzmo
15 Oct 2007, 11:44 AM
Hi

ext-base.js
Window XP SP2
FF 2.0.0.0.7 / IE 6


I don't know if this is a bug or not. But when I try to submit a form and return an xml document i get.


missing ) in parenthetical
<result success="true">\n

This is the xml document:


<?xml version="1.0" encoding="UTF-8"?>
<result success="true">
<msg>Your changes was sucessfully!</msg>
</result>

But if I do a Ajax request and return the same xml document it returns successfully.

This is one of the testcases I used.


var Page = function() {

var fp = null;

return {

init : function() {

new Ext.Button({
renderTo: 'btn-test1',
text: 'Test1',
handler: Page.test1
});

new Ext.Button({
renderTo: 'btn-test1',
text: 'Test2',
handler: Page.test2
});

fp = new Ext.FormPanel({
renderTo: 'form',
defaultType: 'textfield',
items: [{
fieldLabel: 'Test',
name: 'test'
}]
});

},

test1 : function() {

Ext.Ajax.request({
method: 'POST',
url: basePath+'/resources/test.xml',
success: Page.onSuccess,
failure: Page.onFailure
});

},

test2 : function() {

fp.form.submit(
method: 'POST',
url: basePath+'/resources/test.xml',
success: Page.onSuccess,
failure: Page.onFailure
});

},

onSuccess : function(o) {
alert('success');
},

onFailure : function(o) {
alert(o.status);
}

};
}();

Ext.onReady( Page.init );

Johan

jack.slocum
15 Oct 2007, 12:25 PM
Please look at the xml form example in the examples/form directory.

You need to configure XML loading. Your code is trying to eval the XML as json since you haven't configured it for XML.